Niko S
Niko S

Reputation: 1

How to create a YAML pipeline in Dev Ops to export Power Automate solution and Import it to Dev Ops Project?

I would like to export a Power Automate solution (TestSolution) from the environment (TESTW) and import it into the project (ProjektTest), repo (TestRepo), branch (main). Unfortunately, I'm not very familiar with YAML. How should I set up the YAML pipeline for this? What would the correct code look like? I would like to use my tecnial User (Microsoft Authentification).

I've read that I need to install the Power Platform CLI on my computer. However, it seems that you can also automate this installation through the code, so the CLI gets installed when the pipeline runs.

Does anyone have a similar use case and could perhaps provide a template for this?

I tried generating a YAML code using ChatGPT, but it doesn't work as expected.There are problems with installing CLI and Pac.

Thanks for the help! :-)

Upvotes: 0

Views: 37

Answers (1)

Bright Ran-MSFT
Bright Ran-MSFT

Reputation: 13944

You can use the "Power Platform Build Tools" extension in Azure DevOps. This extension provides extension some pipeline tasks related to Power Platform.

For your case, you can follow the main steps like as below:

  1. Install the "Power Platform Build Tools" extension into your Azure DevOps organization where your project (ProjektTest) is in. enter image description here

  2. In the project (ProjektTest), go to "Project Settings" > "Service connections" to create a Power Platform service connection used by the pipeline tasks to interact with the Microsoft Power Platform environment. enter image description here

  3. In the repository (TestRepo), create a YAML pipeline on the main branch (push the YAML file to the main branch).

  4. In the YAML pipeline, you can use the Power Platform Export Solution (PowerPlatformExportSolution@2) task to export the specified solution from the specified source environment. It will export the files as an ZIP file to the specified path on the agent.

  5. If you want to unzip the exported ZIP file, you can use the ExtractFiles@1 task after the PowerPlatformExportSolution@2 task.

  6. Then you can use a script task (such as Bash@3) to execute the related git commands to add, commit and push the exported ZIP file (or the extracted files) to the main branch of the repository (TestRepo).

For more details about the "Power Platform Build Tools" extension, you can refer to the following documentations:


Upvotes: 0

Related Questions