ALM in Power Platform using DevOps, Power Platform Build Tools and Team Foundation Version Control – Part 3 of 3: Move solution from QUA to PROD and check-in unpacked solution and zip solution file into TFVC Source Control

In this series of articles I want to explain how to configure a simple Application Lifecycle Management (ALM) process using DevOps and TFVC as an alternative to Github into Power Platform context.

I will show that by creating two simple Azure Pipelines: the first move the solutions from source to destination environment and the second store both the .zip solutions file and unpacked solution artifacts into TFVC Source Control.

In the first article I cover all related to the initial configuration of Power Platform Environments and DevOps.

In the second article, I show how to configure the first simple Azure Pipeline to move a single unmanaged solution from DEV environment to QUA environment.

In this article, I will show how to configure the second simple Azure Pipeline to move a single unmanaged solution from QUA environment to PROD environment and check-in unpacked solution and zip solution file into TFVC Source Control through the following steps.

This is the scenario:

Open Azure DevOps, go to configured Project and select Pipelines area

Now, select New Pipeline

Select as source TFVC

Choose Empty Pipeline as template

Rename the Pipeline (i.e. QUA to PROD) and insert the following job steps from Power Platform Build Tools, mantaining this sequence:

1 Power Platform Tool Installer (used to install the tools into pipeline)

2 Power Platform Set Solution Version (used to increase solution version in DEV)

3 Power Platform Publish Customizations (used to publish customizations into DEV)

4 Power Platform Set Solution Version (used to increase solution version in QUA)

5 Power Platform Publish Customizations (used to publish customizations into QUA)

6 Power Platform Export Solution (used to export customizations from QUA)

7 Power Platform Checker (used to check customizations exported from QUA)

8 Power Platform Import Solution (used to import customizations into PROD)

9 Power Platform Publish Customizations (used to publish customizations into PROD)

10 Power Platform Unpack Solution (used to unpack PROD solution)

11 Adding Files to Source Control TFS (used to add unpacked and zip file solution to TFVC)

12 Check changes into Source Control TFS (used to check in zip file solution to TFVC)

13 Check changes into Source Control Unpaked (used to check in unpacked files solution to TFVC)

After, under Variables tab, create a new variable SolutionName and set the value (in my case is ALM)

Now, for each step we must configure all the necessary informations

1 Power Platform Tool Installer (used to install the tools into pipeline)

Check Use Default Version

2 Power Platform Set Solution Version (used to increase solution version in DEV)

Select Auth Type to Service Principal MFA

Select the Service Connection

Set Solution Name to $(SolutionName) using in this case the variable

Set Solution Version Number to $(Build.BuildNumber) to add an unique suffix to solution

3 Power Platform Publish Customizations (used to publish customizations into DEV)

Select Auth Type to Service Principal MFA

Select the Service Connection

4 Power Platform Set Solution Version (used to increase solution version in QUA)

Select Auth Type to Service Principal MFA

Select the Service Connection

Set Solution Name to $(SolutionName) using in this case the variable

Set Solution Version Number to $(Build.BuildNumber) to add an unique suffix to solution

5 Power Platform Publish Customizations (used to publish customizations into QUA)

Select Auth Type to Service Principal MFA

Select the Service Connection

6 Power Platform Export Solution (used to export customizations from QUA)

Select Auth Type to Service Principal MFA

Select the Service Connection

Set Solution Name to $(SolutionName) using in this case the variable

Set Solution Output File to $/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip

7 Power Platform Checker (used to check customizations exported from QUA)

Select the Service Connection

Check use default Power Apps Checker endpoint with Local File option

Set Local File to Analyze to $/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip

Set Rule Set to Solution Checker option

8 Power Platform Import Solution (used to import customizations into PROD)

Select Auth Type to Service Principal MFA

Select the Service Connection

Set Solution Input File Name to $/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip

Under Advanced, check overwrite unmanaged customizations

9 Power Platform Publish Customizations (used to publish customizations into PROD)

Select Auth Type to Service Principal MFA

Select the Service Connection

10 Power Platform Unpack Solution (used to unpack PROD solution)

Set Solution Input File to $/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip

Set Target Folder to Unpack Solution to $/your-devops-project-path/UnpackedSolutions/$(SolutionName)

Set Allow overwrite of existing files option

11 Adding Files to Source Control TFS (used to add unpacked and zip file solution to TFVC)

Set Files to Add to

$/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip
$/your-devops-project-path/UnpackedSolutions/$(SolutionName)

Set Recursion to Full options

12 Check changes into Source Control TFS (used to check in zip file solution to TFVC)

Set Files to check in to

$/your-devops-project-path/Solutions/$(SolutionName)_$(Build.BuildNumber).zip

Set Recursion Full option

Set Check-In comment to $(Build.BuildNumber)

13 Check changes into Source Control Unpaked (used to check in unpacked files solution to TFVC)

Set Files to check in to

$/your-devops-project-path/UnpackedSolutions/$(SolutionName)

Set Recursion Full option

Set Check-In comment to $(Build.BuildNumber)

Now, after this steps, we are able to try the pipeline

Go to principal Pipelines area and select Run Pipeline from more option menu

During the execution we can see the detail of each steps configured in the pipeline, as follows

In this case there is no error and the execution is successful!

In my scenario into QUA environment (ALM Source), I have a solution named ALM that contain Account entity where I added a custom field

After Pipeline execution, checking my PROD enviroment (ALM Destination) initially without custom solutions, I can now see my ALM solution containing the account entity with the new custom field

Now, go to Azure Repos, the folder structure turns out to be the following:

  • Solutions (to store all zip files and create a repository of all solutions for recovery)
  • UnpackedSolution (to store all file of unpacked solution)

In Backup folder there are all zip files!

In UnpackedSolutions instead there are all xml files that compose the solution. Now executing Compare function at folder level we able to see the differences with the previous check-in.

In my case there is a new field on account entity!

Hope it helps and happy 365Power’ing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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