Deployment profiles in Power Apps Portals

IMPORTANT
Help UKRAINE ! Your action matters! Donate to support Ukrainian Army! Donate to charity funds! Organize/join street protests in your city to support Ukraine and condemn Russian aggression! Expose and report Russian disinformation! #StandWithUkraine

A couple of days ago, Microsoft announced support for deployment profiles switch for Portal CLI upload command, which makes the full ALM story for Portals one step closer (see official doc here). Let’s find out what deployment profile is and how my Portal Helper extension can help you working with them.

Deployment profile

So what is a deployment profile? The deployment profile allows you to define a set of variables for the environment in YAML format. For example, you have some site setting that has different values across your dev, test and prod environments. Previously, you needed to either not deploy that site setting and create it manually or change it after the deployment. But now you can create files with specific values for each environment that will be used during the deployment process.

Creating deployment profile

To create a deployment profile you need to create a deployment-profiles folder in the root folder of your portal. This folder will contain all your deployment profiles and will not be overridden during the download command. Then you need to create the profile itself - inside the deployment-profiles folder create a file PROFILE_NAME.deployment.yml (for example test.deployment.yml). The file should contain a table name with the list of attributes and respective values. You can have multiple tables and records specified in the same file.

adx_contentsnippet:
    - adx_contentsnippetid: 09d34372-8420-ec11-b6e6-000d3ab86fbc
      adx_name: Legal text
      adx_value:  Some legal text
    - adx_contentsnippetid: 09d34372-8420-ec11-b6e6-000d3ab86f12
      adx_name: Search Title
      adx_value: Search
adx_sitesetting:
    - adx_sitesettingid: 09d34372-8420-ec11-b6e6-000d3ab86f45
      adx_name: Authentication/OpenAuth/Google/Secret
      adx_value: some-google-secret
    - adx_sitesettingid: 09d34372-8420-ec11-b6e6-000d3ab86f34
      adx_name: Authentication/OpenAuth/Facebook/Secret
      adx_value: some-facebook-secret

Upload portal with the deployment profile

To upload the portal with the specified profile you need to use deploymentProfile parameter in the upload command:

pac paportal upload --path "C:\Code\Portals\starter-portal" --deploymentProfile test

Portal helper to the rescue

Portal Helper is an extension that I developed to help users to work with Portal CLI more efficiently (Github page). With this update, I am adding two new things.

First, Upload Portal command now support the deployment profiles parameter. Moreover, if you have deployment profiles extension will prepopulate dropdown with them for faster selection.

Also, I created a new command called Create Deployment Profile, which will create a YAML file for you and a folder for them if it didn’t exist previously.

Conclusion

I am really happy that MS continues to develop the portal part of MS Power Platform CLI allowing us to do much more. A deployment profile is an awesome feature that solves one of the most annoying obstacles on the ALM journey. I will continue to develop my extension so it supports the latest features and makes developers life easier.