Automate Solution Deployments with approvals using Power Platform Pipelines

By | February 5, 2024

In the dynamic landscape of technology, organizations are constantly seeking efficient ways to deploy solutions seamlessly. Power Platform Pipelines emerge as a powerful tool to automate solution deployments, providing a streamlined approach to managing and delivering applications. It helps ensure consistency, time efficiency, and maintaining version control.

Firstly, you need to install the “Power Platform Pipelines” application in the host environment. You can refer to the below links for the Installation of Power Platform Pipelines in your host environment.

https://learn.microsoft.com/en-us/power-platform/alm/set-up-pipelines#install-the-pipelines-application-in-your-host-environment

Note:

  • You must have a Power Platform administrator or Dataverse system administrator role to install the application of the pipeline.
  • Both Host and Destination environments must be in the same geographic location.

After installation is done, the next step is to create a Pipeline that will automate the solution deployments from Source to Destination environments. You can refer below link for the configuration of Pipelines in your host environment.

https://learn.microsoft.com/en-us/power-platform/alm/set-up-pipelines#configure-a-deployment-pipeline

I have created one pipeline in my host environment and also added the target environments where I want to automate the solution deployments. Please check the below screenshot for the same.

Power Platform Pipelines

You need to add and validate all the environments that you want to use for automating the deployments. In this case, as we only have one target environment hence we have added only one under the deployment stage.

– Use this if you want to set up Approvals for the deployments

Once Pipeline has been set up, you can go to any unmanaged solution in your host environment and you will see the pipelines icon on the right side of the navigation menu.

Power Platform Pipelines

Now if you go to the pipelines menu then you will see the pipelines available from the host environment. You can also schedule the deployment based on a certain time like outside client business hours. If your pipeline does not have an approval process then deployment will start immediately once you specify the time to run the deployment. Please refer below screenshot for the same.

Power Platform Pipelines

In our case, we will see how to automate solution deployment by defining the approvals.

To add approvals, you need to enable the “Pre-Deployment Step Required” checkbox under the deployment stage in your pipeline.

Power Platform Pipelines

Once the above config is done, now further the approval process we will define in Power Automate.

You need to use “When an action is performed” as the trigger to automate the process. The category should be Power Platform Pipelines and the action should be OnPreDeploymentStarted.

Power Platform Pipelines

Next, you need to retrieve the deployment stage from the pipelines.

Power Platform Pipelines

Now we need to define approvals in Power Automate for admin to approve the deployment. You can add all the important details like Pipeline Name, Solution Name, Scheduled Deployment Time, etc. in the details for the approver to approve the deployment by looking at the details of the deployment.

Power Platform Pipelines

Now based on the approval process response we will add a condition to Approve the deployment or Decline the deployment.

Power Platform Pipelines

There is an OOB unbound action that you can use to update the Pre-Deployment Step status. It has the below set of values

Pending – 10

Completed – 20

Failed – 30

If the deployment is approved then we will update the Pre-Deployment Step Status value to 20 and if the deployment is rejected then we will update the Pre-Deployment Step Status value to 30.

Power Platform Pipelines

Power Platform Pipelines

This way approval process has been set up. Now we will go back to the pipeline and start with the deployment process.

Now because we have added an approval process in our pipeline hence it will go into a waiting state after passing all the validation. It will wait for the request to be approved to start the deployment.

Power Platform Pipelines

Once the request is approved, we can see the deployment started automatically.

Power Platform Pipelines

It will take some time for the solution to be deployed to the QA environment. Once done you will see the last deployed date updated automatically.

Power Platform Pipelines

Conclusion

Automating solution deployments with Power Platform Pipelines brings numerous advantages, ranging from enhanced consistency to time efficiency. Also, using approvals makes it easy for admins to decide whether to approve/reject the deployment considering risk factors.

Microsoft Power Platform