Code - The new easier way to pack and unpack canvas app source code
If you're building canvas apps from source code, there's now a much easier way to unpack the source from a source MSAPP file, thanks to the "Power Platform VS Code Extension" for Visual Studio Code. This post describes this new feature.
Setting up a machine to unpack/pack source code
To setup a machine to unpack/pack source code, we download and install Visual Studio Code from the following link:
On a Windows machine, the downloaded file is 76MB, and the installation requires just under 200MB disk space.
Once Visual Studio Code is installed, we click the extensions icon from the left hand pane (the icon with 4 rectangles), and search for the 'Power Platform VS Code Extension'. As the screenshot beneath shows, the installation of the extension adds pac CLI 1.6.7 (the version that first includes the version of pac with canvas app support).
How to unpack an MSAPP file
To unpack an msapp file, we run start a new terminal window by clicking the Terminal > New terminal menu item, and running the following command:
pac canvas unpack --msapp C:\PowerApps\MSAppFiles\IssueAppSQL.msapp
- Source msapp file: C:\PowerApps\MSAppFiles\IssueAppSQL.msapp
- Target output folder: C:\PowerApps\ProjectFiles\IssueAppSQL
Editing the source with the VS Code extension
We can now edit our source code in the same Visual Studio code window by typing the following command:
code -r C:\PowerApps\ProjectFiles\IssueAppSQL
Packing the an MSAPP file
pac canvas pack --sources C:\PowerApps\ProjectFiles\IssueAppSQL
- How Power App builders can more easily connect to code that has been written by pro-developers
- Code - How to define a read-only table of static data
- Code - Where do we define datasource, table, and field definitions?
- Code - Template Apps - How to unhide/re-enable the data panel
- Intro - How to build Canvas Apps with code