In order to fully utilise managed solutions in your build and release pipelines you need to make sure the solutions are always incrementing their version (the platform will usually block you trying to install the same version of a solution. This post will help guide you through the process in Azure DevOps using the Microsoft provided Power Platform Build Tools available from the MarketPlace.
Prerequisites
You will need an Azure Git Repository set up in your Azure DevOps project. In this example we will call it PP_Solutions (short for PowerPlatform Solutions). I would recommend you keep your PowerPlatform solutions in their own repository - it makes later steps much easier. You can read more about how to create a new Git repo in your project.
Create connection to Power Platform
- Click the Project Settings link at the bottom of the left navigation
- Select Service Connections
- Click the New service connection button in the top right
- Select Generic, scroll to the bottom of the page, then click Next
- Enter the following details for your Power Platform dev environment
- The Url
- The username (requires System Customizer privileges as a minimum)
- The password/token for the above user account
- The name for the connection - I usually use something like <Env>-Dev, where <env> is the name of the environment/project you are working with.
- Check the Grant access permission to all pipelines checkbox
- click Save
Creating the pipeline
This blog post won't take you through installing the extension set itself (that may come in the future if needed) but will focus on setting up the pipeline itself.
- In the left navigation of DevOps, click on Pipelines
- Then click on the New pipeline button in the top right
- Select Use the classic editor
- Select the Repository
- Select the Team Project (the current project)
- Select the repository (PP_Solutions)
- Select the main branch
- click Continue
- Select a template
- select the Empty job option link at the top of the list of types.
Configuring the pipeline
- Name: I usually name them in a manner that lets me follow the order easily such as: 01 - Set Solution Version, or PP-01 - Set Solution Version
- Agent Pool can be left as default for now
- Agent Specification: leave as default or select Windows-Latest so you don't have to keep updating it.
- Next, click on the item called Agent job 1, change the name to Set Solution version (you can update the name if you want, I would recommend setting a name if you are going to have additional jobs in a single pipeline).
- Then in the additional options, check the Allow scripts to access the OAuth Token checkbox.
Adding the build pipeline tasks
- Click the + icon
- In the search box type Power Platform Tool Installer
- Click Add next to the task that's displayed under the search box
- Again, in the search box type Power Platform Set Solution Version
- Click Add next to the task that is now displayed under the search box.
Configuring the pipeline tasks
- Select the task from the list of tasks under the Agent Job Set Solution Version
- Select the connection you created to your dev environment in the prerequisites step
- Enter the solution name (in this case its SS2022)
- For the Solution Version Number I like to add the build ID to get an automatically incrementing number, in this case enter 1.0.0.$(Build.BuildId).
No comments:
Post a Comment