Many of customers and Partner are very familiarized with the process of continuos integration using Azure pipelines and how to deploy the package in sandbox environments using Lifecycle Services. This articule expand the explanation on how to implement continuous integration and deployment (CI/CD) of Power Platform unified developer experience assets.
Prerequisites
Before you can add these steps to a pipeline, the Dynamics 365 finance and operations Tools and Power Platform Build Tools extension for Azure DevOps must be enabled and installed in the Azure DevOps account. For more information about how to install an extension for an organization, see Install extensions.
Create a pipeline
A full pipeline should consist of at least the following steps:
- Install the NuGet packages.
- Update the model versions.
- Build the solution or projects.
- Install NuGet 3.3.0 or earlier on the agent. (This step is required for the step that creates the deployable package.)
- Create the deployable package.
- Publish the deployable package artifact as the build output.
The process for building your solution remain the same and can be based on the current that you have in your project, but some additional configurations will be required for create deployable package that can be used on the Power Platform Unified environments.
Azure DevOps provides pipelines that can be used to automate builds. There are two types of pipelines: YML and Classic. YML pipelines are available only when you use Git source control repositories. Classic pipelines must be used to build Team Foundation Version Control (TFVC) repositories. For more information, see Azure Pipelines.
In my case, I am using Git as source control repository and a YML file to define all steps of my pipeline. One of those steps is to create a deployable package that should be adjusted to version 1 to enable the option to create Power Platform Unified Package and additionally maintain the option to Create Lifecycle Service Software Deployable Package.
Another change, is the way of license file is included in the package, is necessary same as the previously step, adjust the version of the task to version 1 and generate one individual task per model if model requires a license file.
Add a task for each model that the license is needed. Modify the path to the deployable package created in previous step. If the package folder created in the previous step is not provided as input to this step correctly you may see the error ‘fnomoduledefinition.json file not found’.
Another way to simplify that part is include the license in the model. Licenses can be directly included and deployed by placing them in the __License (with two underscores) folder in the model, at the same level as your bin folder. This license is verified and applied when you deploy the package.
Once the pipeline is built, locate the published artifacts under Related in the Summary tab.
Now you can run your build pipeline and see the packages generated, one for Lifecycle Service Software deployable package, and multiple for your PPAC environments.
Release pipeline for Unified environments
In order to complete this section, it is necessary to validate that the prerequisites, the Power Platform Build Tools, must already be installed in order to use them as steps in the pipeline agent.
- Create a release pipeline, choosing the build pipeline from the preceding section.
2. Rename the stage 2 “Deploy UDE Package” and add the following task on that
- Power Platform Tool Installer
- Power Platform WhoAmI
- Power Platform Deploy Package
The steps of Power Platform WhoAmy and Power Platform Deploy Package, require a service connection that enable task to interact with the environment in PPAC.
Create service principal and client secret
In my case, I created a new App registration in the Azure portal, which I then added as application users in the Power Platform environment with the “System Administration” role
Note: Service Principal and username/password authentication methods are available for the checker task. For more information on how to configure service principals to be used with this task, see Configure service principal connections for Power Platform environments.
The previously App registration is used to create the connection between Devops and PPAC and it will be used to Power Platform WhoAmy and Power Platform Deploy Package
For the Power Platform Deploy Package step, you should point the Package File to the “TemplatePackage.dll” generated in the build pipeline
After you complete all of those steps and save the release pipeline, now you can test the solution generating a new build a release pipeline.