Set up Azure DevOps Pipeline for Power Platform - Continuous Deployment (Part 2)

2 minute read

Set up Azure DevOps Pipeline for Power Platform - Continuous Deployment (Part 2)

Overview

Azure DevOps pipelines make it easy to automate exporting solutions from one environment to importing to other.

In the previous article, we covered how to export the Power Platform solution from one environment, and in this article, we will import it to another environment.

The Plan

The Power platform solution, we exported from the source environment (Nanddeep Nachan's Environment) will now to imported to the target environment i.e. nachan365 (default).

Azure AD App Registration

We will use the same Azure AD app registration from the previous article, instead of creating a new one.

Create system user in Dataverse pointing to Azure AD App registration

  1. Open Power Platform Admin center.
  2. Navigate to the source environment.
  3. Click Settings.
  4. Under Users + permissions, click Users.
  5. Click the app users list.
  6. Click + New app user.
  7. Click + Add an app.
  8. Select the previously created Azure AD app from the list.
  9. Click Add.
  10. Select the Business unit.
  11. Under Security roles , select System Administrator.

  12. Click Create.

Create Azure DevOps Pipeline - Service Connection

  1. In the Azure DevOps, navigate to your project.
  2. From the bottom left, click Project settings.
  3. Under Pipelines, click Service connections.
  4. Click Create service connection.
  5. Search and select Power Platform.
  6. Click Next.
  7. Provide the service connection details from previous configurations.

  8. Click Save.

Now, we should have 2 service connections each pointing to the source and target environment.

Create Release Pipeline

We will not automate the release process by setting up a new pipeline.

  1. In the Azure DevOps project, click Pipelines > Releases.
  2. Click New pipeline.

  3. We will start with the Empty job.

  4. Name the stage (e.g., by the target environment)

  5. Select the Source type as Build.
  6. Click Add.

  7. Click 1 job, 0 task.

Add Tasks to the pipeline

Add below tasks to your pipeline.

Task #1: Power Platform Tool Installer

This will install the Power Platform Build Tools.

Task #2: Power Platform Import Solution.

This will import a solution into a target environment.

  1. Specify Service connection
  2. For the Solution Input File (which is expected to be zip), specify the path from the drop folder, where the build pipeline produces the artifacts.

Task #3: Power Platform Publish Customizations.

This will publish all customizations in an environment.

Execute the release pipeline

Click Create Release from the top to start the release pipeline.

Wait for the release pipeline to finish.

The End Result

Once the release pipeline finishes successfully, the Power Platform solution will be deployed to the target environment.

Summary

Azure DevOps pipelines make it easy to automate to move your solutions from one environment to other. Power Platform Build Tools tasks help to automate common build and deployment tasks in Azure DevOps pipelines.

References

Leave a comment