Power Platform: import a Solution with an Azure DevOps Pipeline

Why?

In the previous post Power Platform: export a Solution with an Azure DevOps Pipeline » Knowhere365, I showed how to export all variants of a Power Platform Solution to a Git Repo. We are going to use the output of that Pipeline to import the solution to another Power Platform Environment.

What?

In this post we are going to use another Azure DevOps Pipeline to import a Power Platform Solution from a Git Repo to a Power Platform Environment.

How?

1) Create a new Pipeline as explained in Power Platform: setting up an Azure DevOps Pipeline » Knowhere365. I will create a Pipeline named Import Teams KickStart App to TST. I will save it to our Git Repo as a pipeline20importteamskickstartapp.yml file. Right next to the Export from DEV Environment Pipeline:

2) Add an Application User to the target Power Platform Environment as explained in Power Platform: connect an Azure DevOps Pipeline » Knowhere365. The same steps as for the DEV Environment:

3) Create the Service Connection in the Azure DevOps Project for the TST Environment as explained in Power Platform: connect an Azure DevOps Pipeline » Knowhere365. All data the same as the DEV Connection:

4) Create a Variable Group for our TST Environment as explained in Power Platform: export a Solution with an Azure DevOps Pipeline » Knowhere365. Again I named the Variable Group after the environment it will target:

5) Now all is set to add the next code to this simple Pipeline using the Managed Solution from our Git repo (for details on the type of Tasks see Build tool tasks – Power Platform | Microsoft Docs):

trigger: none
pool:
  vmImage: windows-latest

variables:
- group: 'insbatst01'

steps:
# Prepare #
  - checkout: self
    persistCredentials: true
  - task: PowerPlatformToolInstaller@0 #Always Install this when using PowerPlatformBuiltTools on machine
    displayName: 'Prepare - Install PP Tool'
    inputs:
      DefaultVersion: true

  - task: PowerPlatformImportSolution@0
    displayName: 'Install solutions'
    inputs:
      authenticationType: 'PowerPlatformSPN'
      PowerPlatformSPN: 'insbatst01connection'
      SolutionInputFile: '$(System.DefaultWorkingDirectory)/$(GitDirectoryExportedSolutions)/$(PowerPlatformSolution01)M.zip'
      AsyncOperation: true
      MaxAsyncWaitTime: '60'

Run it successfully:

And see the Solution being imported in your target environment:

That is it! Now we have one Pipeline to export the Managed Solution from DEV. And we have another Pipeline to import the Managed Solution to TST 💪👍.

6 thoughts on “Power Platform: import a Solution with an Azure DevOps Pipeline

  1. Thanks for providing this great content.

    I followed the same steps, but after import I am not able to see the imported managed solution in target environment. I am not sure what I was missed. In pipelines the import task showing as successfully deployed.

    could you please help me here.

    1. Does the job give any more detail?
      It is impossible to troubleshoot with just the information you are providing 😁.
      My initial thoughts would be: are you checking the right Power Platform environment to verify the installation? are you using the right service connection to the right Power Platform environment?

      I can also recommend posting your specific case in the Community: https://powerusers.microsoft.com/t5/Power-Apps-Community/ct-p/PowerApps1 because there you can easily add screenshots and get help from other people.
      Feel free to mention me (https://powerusers.microsoft.com/t5/user/viewprofilepage/user-id/16471) 👍

Leave a comment