As you all know Application Life Cycle Management(ALM) is very important for a project to become successful in this automation era. The faster is the iteration speed to deploy your solution to production, the more healthy your project is and so your stakeholders. This kind of Automation is usually made possible with the help of CI/CD Azure Pipelines. CI/CD for GIT Repo for Azure DevOps is famous from quite some time. You might have heard that Microsoft had got this kind of CI/CD architecture to Power Platform released in Preview last year and is now Generally Available(GA).
But if you still don’t really have a hands on and pretty new to get this into your project, then this blog post is for you. You don’t need to know Azure DevOps or at least you don’t need to be technical to use this new capability, even administrators can. All you need is to just follow along….
First of all, let’s see what are the prerequisites to create a Power Platform Pipeline.
- Four environments are recommended, but you can use as few as three environments to create a pipeline.
- Dataverse database is a must in all the environments except the Host Environment.
- Dataverse for Teams environments aren’t supported for use with pipelines.
- You must have a Power Platform administrator or system administrator role.
- Pipelines are a feature of Managed Environments. As such, the development and target environments used in a pipeline must be enabled as a managed environment. Standalone licenses won’t be required when you use developer or trial environments with pipelines. More information: Managed Environments.
- If you want to share these pipelines, you should grant access by opening the security from the host environment. The Deployment Pipeline User security role grants access to run one or more pipelines.
Now let’s see how you can set up Power Pipelines…
You need to identify which of your environments you want to configure pipeline for. For a healthy pipeline, at least you need 3 environments ie. Dev, Test, Prod, however there is no upper cap.
So for configuring our pipeline, we need one more environment in addition to above which is nothing but Host Environment which serves as the environment which stores all the configuration of the pipeline.
So below are our environments we will be using in this tutorial…
Development Environment (Required)
You can navigate to https://admin.powerplatform.microsoft.com/ to create an environment with Dataverse database or follow this.
First thing, you have to do is to set up the host environment which holds the configuration of your pipeline. The configuration is pretty much easy and intuitive to follow. Make sure you choose same region to all your environments and select type as Production for all environments except developer environment. You don’t actually need to create a database as this stores only the configuration.
In the same way, I have already created the host environment and I also have few trials which I will be one of them as my test environment and one as my Developer environment, we can also configure other environment but for brevity I am leaving one not configured. Make sure to check Create database for this environment while you were creating for all the environments except the Host Environment.
For setting up the pipeline, you need to have the Environment Id’s of the environments which you would like to configure ready. Follow this link if you don’t know how you can get them.
Copy and paste them in a notepad for your quick reference during configuration.
Open the host environment from Admin portal and click on Resources Option available and click on Dynamics 365 apps.
In the next window, click on Install app and in the list of apps, choose Power Platform Pipelines, click on Next and install the app after agreeing the terms of service.
Now you need to open the host environment from https://make.powerapps.com to configure the pipeline and you should an app for Deployment Pipeline Configuration as below.
Open this app as below and configure the environments which you want to use in your pipeline, set up the Development environment from where you would like to deploy the changes to your target. Make sure you select Environment Type as Development Environment and provide the respect Environment Id which you copied to your notepad earlier as above.
Similarly configure the other target environments, but proceed to select as Target Environment as the environment type. Once after system validation is done, validation status is shown as successful and the environments setup will look as below.
Now you need to create a pipeline for the configured environments, once saved, link the development environment which you configured above.
Next is configure your target environments for the pipeline to which you would like to deploy your solutions, from the quick create, give a name, choose your Previous Deployment Stage lookup and select the target environment you would like to Deploy from the lookup.
Once setup, your power pipeline should look something as below.
Note: While you are configuring the first stage to deploy to Test environment, you need leave the Previous Deployment Stage as empty.
Now go back to your Development environment, include any power platform component which you would like to deploy to next environment, here for simplicity I added one Canvas App to the solution as below.
The Canvas App component added and as soon as you select or even before you should see a Pipeline symbol as highlighted below….
Note: This icon will be appeared if you have setup everything correctly, if you still don’t see this option when you try to deploy component from Dev, then you need relook at your configuration which you have setup in the host environment, either you gave the wrong environment Id or you configured incorrectly.
Once this icon is being shown, you are set to go…once you click on the Pipeline symbol, it takes you to a new screen showing your pipeline as below
All you need to just click on Deploy here and wait for a couple of mins to Deploy the solution to next environment to Test and you should see below screen. Then click on Deploy.
Once deployment is successful, then you should see Deploy to next environment(Prod) also enabled.
That’s it, lets see if our Solution is deployed to our Test and Prod Environment.
Use environment names that indicate their purpose, I have used trial environments for demo purpose but this feature is Generally available, so you might try it out in your actual projects meaning the deployed solution will be managed and not editable as below.
- Deleting the host environment deletes all pipelines and run data. Use caution and understand the impact of data and configuration loss as well as maker access to pipelines hosted in the environment.
- After General availability all the environment will be automatically enabled as managed environments, so you don’t need to worry much about setting up the environment as Managed.
- Licensing is also not a problem if you are a maker who’s creating the pipeline, you need to give the Deployment Pipeline Administrator and Deployment Pipeline User to the maker/user and share the pipeline for them to run it.
Hope you found this post helpful and you should definitely incorporate this feature in your projects to deploy managed solutions from one environment to another. How cool is this one….