Application Lifecycle Management (ALM) and Power Pages Power Pages image 19

In my recent posts about Power Pages, I’ve looked at development of pages, but I’ve not considered Application Lifecycle Management (ALM) yet.

Application Lifecycle Management

In general I would recommend to have at least 3 environments for any development work. These environments should include:

  • Development
  • Test
  • Production

But they could also include environments like training, UAT and quite a few more depending on your ALM need. But with Power Pages, how do we deploy the pages from dev to test and to production?

In this post you will find the first steps towards implementing the development processes needed.

Prerequisites

First of all you will need to install Visual Studio Code (well, you can do without but it will make things easier)

Then within Visual Studio Code install the following extensions:

  • Power Platform Tools
  • PowerShell
Application Lifecycle Management (ALM) and Power Pages Power Pages image 19

Connecting to your Power Pages environment

To connect to your environment you will need to know the url for your environment. YYou can find this within the Power Platform admin center. Using this url you can now run the following in your PowerShell within Visual Studio Code. You can of course also use the Command Prompt or PowerShell ISE. They should all recognise the comma

pac auth create -u https://org2bda32ab.crm11.dynamics.com

When you run the above command you will get a login window and after completing that

'account@PieterVeenstraMVP.onmicrosoft.com' authenticated successfully.
Validating connection...
Connected to...PowerPagesPreview-060722-172020
Authentication profile created
    * DATAVERSE                                https://org2bda32ab.crm11.dynamics.com/  : account@PieterVeenstraMVP.onmicrosoft.com Public


Now you may have multiple Portals within your environment. In my case I have 3 of them. To get an overview the pac paportal list command is available.
Application Lifecycle Management (ALM) and Power Pages Power Pages image 20

Using the GUIDs listed for each of the sites we can pick up the code that we are after.

Download a Power Pages environment

To download the first site listed we could now use the following line of code

pac paportal download –path c:\projects\myportalcode -id 2ad72608-51e5-ec11-bb3e-002248009f6c

Notice that if you have gone through these steps before you might want to add –overwrite to the above line.

Your terminal output should look like this:

Started downloading website 2ad72608-51e5-ec11-bb3e-002248009f6c
Connected to...PowerPagesPreview-060722-172020
Downloading: Website [adx_website]...
Downloaded: Website [adx_website]
Downloading: Publishing State [adx_publishingstate]...
Downloading: Table Permission [adx_entitypermission]...
Downloading: Website Language [adx_websitelanguage]...
Downloading: Bot Consumer [adx_botconsumer]...
Downloading: Web File [adx_webfile]...
Downloading: Website Access [adx_websiteaccess]...
Downloading: URL History [adx_urlhistory]...
Downloading: Website Binding [adx_websitebinding]...
Downloading: Site Setting [adx_sitesetting]...
Downloaded: Publishing State [adx_publishingstate]
Downloaded: Bot Consumer [adx_botconsumer]
Downloaded: Web File [adx_webfile]
Downloaded: URL History [adx_urlhistory]
Downloading: Page Template [adx_pagetemplate]...
Downloaded: Website Binding [adx_websitebinding]
Downloading: Web Template [adx_webtemplate]...
Downloaded: Site Setting [adx_sitesetting]
Downloaded: Website Language [adx_websitelanguage]
Downloading: Web Page Access Control Rule [adx_webpageaccesscontrolrule]...
Downloading: Site Marker [adx_sitemarker]...
Downloading: Ad [adx_ad]...
Downloading: Redirect [adx_redirect]...
Downloading: Poll [adx_poll]...
Downloaded: Page Template [adx_pagetemplate]
Downloaded: Ad [adx_ad]
Downloaded: Web Template [adx_webtemplate]
Downloaded: Site Marker [adx_sitemarker]
Downloaded: Website Access [adx_websiteaccess]
Downloaded: Redirect [adx_redirect]
Downloaded: Poll [adx_poll]
Downloading: Ad Placement [adx_adplacement]...
Downloading: Shortcut [adx_shortcut]...
Downloaded: Table Permission [adx_entitypermission]
Downloaded: Web Page Access Control Rule [adx_webpageaccesscontrolrule]
Downloading: Tag [adx_tag]...
Downloaded: Ad Placement [adx_adplacement]
Downloading: Poll Placement [adx_pollplacement]...
Downloaded: Shortcut [adx_shortcut]
Downloaded: Tag [adx_tag]
Downloading: Web Role [adx_webrole]...
Downloaded: Web Role [adx_webrole]
Downloaded: Poll Placement [adx_pollplacement]
Downloading: Web Page [adx_webpage]...
Downloading: Note [annotation]...
Downloading: Basic Form [adx_entityform]...
Downloading: Content Snippet [adx_contentsnippet]...
Downloading: Web Link Set [adx_weblinkset]...
Downloading: Poll Option [adx_polloption]...
Downloading: Advanced Form [adx_webform]...
Downloading: List [adx_entitylist]...
Downloaded: Web Page [adx_webpage]
Downloaded: Web Link Set [adx_weblinkset]
Downloaded: Content Snippet [adx_contentsnippet]
Downloaded: Advanced Form [adx_webform]
Downloaded: Basic Form [adx_entityform]
Downloaded: List [adx_entitylist]
Downloaded: Poll Option [adx_polloption]
Downloaded: Note [annotation]
Downloading: Web Link [adx_weblink]...
Downloading: Basic Form Metadata [adx_entityformmetadata]...
Downloading: Advanced Form Step [adx_webformstep]...
Downloaded: Advanced Form Step [adx_webformstep]
Downloaded: Web Link [adx_weblink]
Downloaded: Basic Form Metadata [adx_entityformmetadata]
Downloading: Advanced Form Metadata [adx_webformmetadata]...
Downloaded: Advanced Form Metadata [adx_webformmetadata]
Downloading: Portal Language [adx_portallanguage]...
Downloaded: Portal Language [adx_portallanguage]
Updating manifest...
Manifest updated successfully.
Portal download succeeded in 33.7305834 secs

Editing your files

When you now open the folder in Visual Studio Code, you will find the full source code of your portal:

Application lifecycle management and exported files

Update Power Pages with your changes

Now to upload your changes, you can either run the following command. Or if you want to upload this to a different environment connect to the other environment first before running the following command:

pac paportal upload –path c:\projects\myportalcode\default-portal-template

So now you can fully manage your source code of Power Pages, just the same way you would for other development projects. And if you want to you could even upload your source code to DevOps or Github.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading