Operating with Power Apps .msapp files
[This article is pre-release documentation and is subject to change.]
unpackcommands are in public preview.
- Preview features aren't meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
createcommand is generally available.
|pac canvas create||Generate a canvas app from a custom connector|
|pac canvas pack||(Preview) Pack sources into an msapp file|
|pac canvas unpack||(Preview) Extract an msapp file into sources|
pac canvas create
Generate a canvas app from a custom connector
This command will generate an
.msapp canvas app based on the OpenAPI definition of an existing custom connector. The app will contain screens, control layout, and Power Fx code generated based on how the actions of the custom connector are defined, with a predefined look and feel. The app can be used to directly exercise the actions defined in the custom connector.
Makers can import the generated
.msapp into Power Apps Studio to play the app, or to do edits and make further customizations. Import the generated app to Power Apps Studio by navigating to File > Open > Browse within Studio.
The following examples show the use of the
pac canvas create command.
- Create a canvas app based on an Open API Definition by display name
- Create a canvas app based on an Open API Definition by id
Create a canvas app based on an Open API Definition by display name
This example creates a canvas app (as a *.msapp file) based on an Open API Definition by using the display name of the connector.
pac canvas create --msapp HelloWorld.msapp --connector-display-name "My Custom Connector"
Create a canvas app based on an Open API Definition by id
This example creates a canvas app (as a *.msapp file) based on an Open API Definition by using the ID of the connector.
pac canvas create --msapp HelloWorld.msapp --connector-id 00000000-0000-0000-0000-000000000000
connector-id are required.
Path to .msapp file to be generated
The display name of the Connector from which the Power App will be generated
The ID of the Connector from which the Power App will be generated
The target Environment ID or URL. Default value is the environment of your currently active Dataverse Auth Profile.
Considerations and limitations:
- The custom connector referenced with the
connector-idparameters must be part of a Solution.
- After importing the app to Studio, there will be no association to the custom connector. The maker must manually add a reference to the custom connector from which the app was generated before the app can be played. See Add data connections to canvas apps for steps. Until this is done, you may see formula errors in the app which will resolve once the connector reference is added. The name of the custom connector you add to the app must match the display name of the custom connector referenced in the
- The app will contain one screen for each
GETaction that the connector defines.
- Other verbs available in custom connectors are not supported.
- The controls rendered on each action's screen are dynamically generated based on how the input and output types of each action are defined. Certain types of input and output defined in the custom connector are not supported by
canvas create. The command will generate warnings in the console when these are encountered. Specific cases:
- Arrays of objects and arrays of arrays are not supported as inputs
- Controls are not generated for objects or nested arrays beyond a depth of 20
- "File" and "binary format" types are not supported for input or output.
pac canvas pack
(Preview) Pack sources into an msapp file
pac canvas pack --sources MyHelloWorldFiles --msapp HelloWorld.msapp
Path to .msapp file
Directory to sources to be packed
.msapp file from the previously unpacked source files.
The result can be opened in Power Apps Studio by navigating to File > Open > Browse.
After being unpacked, the source files can be edited and managed with external tools such as Visual Studio Code and GitHub.
pac canvas unpack
(Preview) Extract an msapp file into sources
pac canvas unpack --msapp HelloWorld.msapp --sources MyHelloWorldFiles
pac canvas unpack --msapp HelloWorld.msapp
Unpacks to default
Path to .msapp file
Directory to sources to be unpacked
.msapp source file.
.msapp file from Power Apps Studio by navigating to File > Save as > This computer.
If the sources parameter is not specified, a directory with the same name and location as the
.msapp file is used with
Unpack and pack properties use the following folder structure:
- \src - Control and component files. This contains the sources.
- *.fx.yaml - The formulas extracted from the
This is the place to edit your formulas.
- CanvasManifest.json - A manifest file that contains the information normally present in the header, properties, and publishInfo.
- *.json - The raw
- \EditorState*.editorstate.json - Cached information for Power Apps Studio to use.
- *.fx.yaml - The formulas extracted from the
- \DataSources - All the data sources used by the app.
- \Connections - Connection instances saved with the app and used when reloading into Power Apps Studio.
- \Assets - Media files embedded in the app.
- \pkgs - A downloaded copy of external references, such as templates, API definition files, and component libraries. These are similar to NuGet/NPM references.
- \other - All miscellaneous files needed to re-create the
- entropy.json - Volatile elements (like timestamps) are extracted to this file. This helps reduce noisy differences in other files while ensuring that we can still round-trip.
- Holds other files from the msapp, such as what's in \references.
.fx.yaml files use a subset of YAML. Similar to Excel, all expressions should begin with an equal sign
=. More information: Power Fx YAML Formula Grammar
Merging changes with Power Apps Studio
When merging changes that are made in two different Power Apps Studio sessions:
- Ensure that all the control names are unique. For example, inserting a button in two different sessions can result in two
Button1controls. We recommend that you name the controls soon after you create them. The tool doesn't accept two controls with the same name.
- For these files, merge them as you normally do:
- If there are conflicts or errors, you can delete these files:
- \src\editorstate*.json - These files contain optional information in Power Apps Studio.
- For any conflicts in these files, it's ok to accept the latest version:
- If there are any merge conflicts under these paths, it isn't safe to merge. Let us know if this happens often; we'll work on restructuring the file format to avoid conflicts.
The canvas commands in Microsoft Power Platform CLI are open source. Discuss improvements, raise issues, and access the code from Power Apps language tooling repository.
Microsoft Power Platform CLI Command Groups
Microsoft Power Platform CLI overview
Submit and view feedback for