Build Azure DevOps Pipelines for Dynamics 365 CRM

Omayma Khammassi
3 min readJan 11, 2022


This article explains how to deploy power apps using the Azure DevOps CI/CD pipeline. We ‘ll go through different steps from the creation of the environment to the pipeline.

Create Environment :

Go to this Url and connect using the Delegated Admin Account:
And select the right customer

Go to Service Management and choose Microsoft Power Platform to access the admin center where the environment gonna be created.
Then click on New , and add the different settings.

FYI: If the environment is either for test or dev choose Sandbox as Type

After the creation of the environment, you still can edit and adjust the security, Url …

Create App registration in Azure:

-Check the followed link:

Create Administrative user

A non-interactive user is a disabled user which cannot do anything and is not consuming a license (because they can’t access CRM), follow the below steps to create one :

  1. Create a user account in the Office 365 Admin Center.
    Be sure to assign a Dynamics 365 (online) license to the account.
  2. Go to Dynamics 365 (online).
  3. Go to Settings > Security.
  4. Choose Users > Enabled Users, and then click a user’s full name.
  5. In the user form, scroll down under Administration to the Client Access License (CAL) Information section and select Non-interactive for Access Mode.
    You then need to remove the Dynamics 365 (online) license from the account.
  6. Go to the Office 365 Admin Center.
  7. Click Users > Active Users.
  8. Choose the non-interactive user account and under Product licenses, click Edit.
  9. Turn off the Dynamics 365 (online) license, and then click Save > Close multiple times.
  10. Go back to Dynamics 365 (online) and confirm that the non-interactive user account Access Mode is still set for Non-interactive.

Create Pipelines:

If in power app you have three environments for dev , test, and Live we‘ll need each time to move the change through them to export the solutions which take time :-) and import them. Now pipeline can do this automatically with only one click: push.
Setup Azure DevOps:
At this stage we‘ll need the saved client secret and Id in the previous steps , in order to create the connection with CRM.
Now in the library create new variable group .
Inside the variable group add for each environment new variable which contains as value the connection string like this example:

Then you are ready to start creating the pipeline. In general, we have to create two pipelines one for ensuring continuous integration which will build the solution and prepare the artifacts and the second one is continuous delivery which will deploy those artifacts to the new host.

In the CRM case, each solution (plugin, web resource, customization, workflow ) has to have a build pipeline and we just need one pipeline for the release.
1-New Pipeline

2-Select Azure git Repo
3-Select the specified repo
4-Add the script yml:
Example to build customization solution:

After adding the yml scripts your pipelines are ready to test.



Omayma Khammassi

Software developer and a lifelong learner.Passionate about Dot.Net application and the Microsoft Azure platforms.