This walkthrough explains how to implement ALM for Power Platform solutions using Azure DevOps, beginning with app registrations and permission setup. It then details how to configure export, build, and release pipelines using the Power Platform toolset. The process enables automated version control, packaging, and deployment of solutions from development to production.
00:00 Intro
00:25 App Registration
01:44 Overview
02:32 Pipeline 1
07:59 Pipeline 2
09:09 Release
10:58 Demo
We're going to go over how to implement ALM with Power Platform Solutions utilizing Azure DevOps, so let's get started. The first thing that you need to do is create an app registration so that Azure DevOps can talk to your Power Platform environments. To do this, you'll go to Azure AD in the Azure portal, then you'll go to App Registrations and create a new app registration, and you'll get to a screen like this. You'll want to make sure that you copy down your client ID and your tenant ID, as well as create a secret and copy that value down, and make sure that you're adding the Dynamics CRM user impersonation permission and give that admin consent.
After you've created your app registrations, you'll then want to make sure that you add them to your Dev and production environment. So I'm in my Dev environment, I click on Settings, I click on Users and Permissions, and then we go to Application Users. This is where you'll add your app registration, and you'll want to make sure that you give it System Customizer or System Administrator. I've chosen System Administrator. This now gives your Azure DevOps access to your Power Platform environment.
Okay, now that we've gotten the app registrations out of the way, now we can jump into Azure DevOps. So let's go over what we need to do within Azure DevOps. Well, we first need to create a project. Second, we need to make sure that we instantiate a repository, and it can just have a README file in it because our exporting tasks within our pipeline are going to take care of what's being stored in our repository. And then we're going to build that solution. By doing that, we are packaging this up so that it's ready for release to the production environment, so it's zipping it all up. And then we're going to create a release to release that to our production environment.
Okay, so what does this look like? Let's jump in. The first thing that you need to do is create an Azure DevOps project. The second is create a repository within that project. Now, that can be an empty repository. It's just a README; that's all you need there. The third thing is we need to get started with our pipelines, and the first one we're going to start with is the export solution.
Okay, so just a note: you do need to add the Power Platform toolset into your Azure DevOps instance, so that requires you going to the Azure DevOps Marketplace and adding the Power Platform toolset, which does require admin consent to do that. So that is a prereq to using some of the tools that you see that I'm using in my Azure DevOps tenant in my projects.
Okay, so I'm in my export solution. This is the first pipeline that you're going to create. Now, you always need to install the Power Platform Tool Installer first. That is a task and it's a prereq to running any other Power Platform tasks. So make sure you get that added in your pipelines first and foremost.
Second, we're going to set the solution version, so this will increment the version when you're importing this into production. Third and fourth is we're going to export an unmanaged and managed solution from your Dev environment. To do that, the first one—unmanaged—you'll want to make sure that the “export as managed solution” is unchecked. I've created a solution name variable because I use this several times within my build pipeline, as you can see here. The output file uses the solutionname.zip, and then you want to make sure that you're using the correct service principal for connecting to your Power Platform environment.
So I've created a Dev and a production service principal, so I'm using the Dev to export my solution from my Dev environment.
We have our unpack solution task, which is essentially unzipping this and making our files human-readable before we check in our solution into our repository. Now, I have checked the “process canvas apps” checkbox, which essentially makes our canvas app files human-readable so that we can get some version control on any changes that we make to our canvas apps.
If you do this, there is a bug that will delete all of your files or add all your files depending on if they're all there or not every time you check in a Power Platform solution. For whatever reason, you need to delete the canvas app folder to prevent that from happening from your exported solutions.
So I have added this delete canvas apps folder task because there is a bug that will either delete or add all of your solution files depending if they're there or not every time you try to check in a solution. So that is necessary if you are checking that “process canvas apps” checkbox.
Okay, so the last task: we are checking in our solution that we just exported and unpacked, which has a nice folder structure, into our repository. I've added a commit comment to this check-in, which takes basically a variable from my pipeline, and I enter that every time I run this pipeline. I actually have an app that I've created to make it super easy to run this pipeline and enter a comment every time you update your Power Platform environment—just make it easy to click that button and upload the new changes that you've done to your Dev environment right into your repository to get that nice version control.
Okay, so that's the export solution pipeline, and that finishes this up. It's probably the most complex build within this process. The others are fairly straightforward, and let's go check out the next one.
Okay, so let's look at the second pipeline that we need to build, and this one's called “Build Solution.” Once again, you'll see the Power Platform Tool Installer first task. You always need to install that first before we add any other Power Platform tasks to our build, so that's done.
The next thing: we just need to pack up the solution, zip it up, and get it ready for production to import into production. The other things are just getting this ready for the release. So we're copying files over to the staging directory—that's our settings folder, which basically just contains the environment variable file so that we can set the production environment variables when we run our release and import that solution into production.
Next is we're putting it in our drop folder so that the release can then pick this artifact up, which is the zipped solution, and import that into production. So it's pretty short and sweet.
Alright, so now let's take a look at the release. Okay, so now I'm in my release, and the release is pretty simple. I have added the drop folder where I dropped my artifact from the last build pipeline, and then I've got two tasks. Pretty straightforward again—we need to add the Tool Installer as a prereq to running any other Power Platform tasks, same thing as the build pipeline.
Then we're going to import the solution. So we grab our prod service principal, and then we are grabbing our solution input file. We are also adding that deployment settings file that I briefly talked about. So I checked the “use deployment settings file,” which prompts this. That JSON file basically contains all the environment variables within our solution, and we're able to then add all the production environment variables to that settings file so that we make sure that the production values are getting set every time we import our solution.
To generate this file, you can use the Power Platform CLI to do that. It will produce an output of all of your environment variables, and you can enter your production values into that JSON file. Pretty straightforward.
So when we run this, it's going to import our solution, and it's going to publish all of our artifacts as well within that solution in our production environment. It's pretty awesome.
Okay, so now let's see this in action. I am going to update my app to show you that this actually is getting updated in production and prove that this all works.
Okay, so I am in my Out of Office app, and I'm actually going to add a text label here to show that this all actually works. So I'm going to say “Hello world, thanks for watching,” and we'll see this come through our version control, and we can see that this message was added.
Okay, so I am in my Out of Office app in my Dev environment, and I want to add a label here just to show you what this looks like when we build and check this in. You'll see that we get version control and can see the little difference that we created in this PowerApp.
Okay, so I'm going to save this, I'm going to publish it, and I'm going to go over, and I am actually going to show you the app that I created to kick off this pipeline. So this is pretty cool. We are going to select the Rock Up Out of Office app, which is the project that I created for this app in Azure DevOps, and I'm going to select the pipeline that I'd like to kick off. That's going to be export solution.
And I'm going to say “Hello demo” for my comment. I'm going to queue that build, and we can see that that build was successful. It gives me the project details, the pipeline arena, and the build ID, which is the version. We can see that's not started yet and the requester.
Okay, so let's refresh this. Oh, we can see that it kicked off, and we can go in here and view this job.
Okay, so we can see that this job succeeded, and that's going to automatically kick off our build solution pipeline, and we can see that that was successful already as well. We can see our “Hello demo” comment on that.
Now I want to show you the repository and the history of this. So we can see that I have my check-in here: “Hello demo,” which you saw me enter, and we can see the differences that were created since my last export. And you can see my comment: “Hello world, thanks for watching.” So this is pretty cool—we get version control within our Power Platform Solutions, just like you would with any other custom solution. I think it's super powerful with Power Platform Solutions.
Okay, so let's take a look at the release. This automatically gets kicked off after the second pipeline has finished. You don't need to do that—you could have approvals before this gets released to production. You can do anything that you have done in the past with releases in Azure DevOps. For demo purposes, I just kept this moving along and had continuous integration set up into my production environment.
So we can see that this got kicked off, and it's importing the solution, and we wait for this to finish as it imports and publishes all of my artifacts.
Okay, so my release finished, and my solution was imported into production, and all my customizations were published—all from the click of a button.
Now, just in case you don't trust me, I'm going to go back and I'm going to go into my production environment Solutions. First of all, we can see the history that this was just imported and published. Let's go into my solution Rock Up Out of Office, and let's open this app and see if the change made it to production.
There it is: “Hello world,” and thanks for watching everyone.
