Monday, 17 February 2025

CI/CD for Dynamics 365 CE using Azure DevOps

 

CI/CD for Dynamics 365 CE using Azure DevOps

We will see how we can implement Continuous Integration (CI) and Continuous Deployment (CD) for Dynamics 365 Customer Engagement (CE) using Azure DevOps. In this blog, we will see how we can deploy a CRM Solution from one CRM instance to another CRM instance, let us say, we have to deploy a CRM solution from the development environment to the QA / UAT environment.

The following components are the pre-requisites, or we are using to implement CI/CD for Dynamics 365 CE using Azure DevOps.

  • Azure DevOps
  • Power DevOps Tools by Wael Hamze
  • Two or more CRM Instances (in my case I am using two CRM instances, one is “Source”, and another is “Destination”)

Let us start implementing CI/CD for Dynamics 365 CE using Azure DevOps.

First, we must install the Power DevOps Tools in the Azure DevOps.

Next, we will create the Build Pipeline and post that we will create Release Pipeline.

Please note, I have already created a CRM solution in my CRM Source instance (refer Fig. 1).

(Fig. 1)

Build Pipeline

In the Build Pipeline, we will export the CRM solution from the “Source” CRM instance and store the solution in the Artifacts in Azure DevOps.

We must follow the below steps to create the Build Pipeline.

1.    Browse your Azure DevOps environment.

2.    Select the Project.

3.    Navigate to the Pipeline and click on the “Create Pipeline” (refer Fig. 2).

(Fig. 2)

4.    Click on the “Classic Editor” (refer Fig. 3).

(Fig. 3)

5.    Select the “Source”, “Team Project”, “Repository”, “Branch” and then click on Continue (refer Fig. 4).

(Fig. 4)

6.    Click on “Empty Job” (refer Fig. 5).

(Fig. 5)

7.    You will be redirected the empty agent job screen (refer Fig. 6).

(Fig. 6)

8.    Rename the Agent Job and click on + and add the new task “Power DevOps Tool Installer” (refer Fig. 7).

(Fig. 7)

9.    Add new task “Export Solution” and configure the connection string, solution name (refer Fig. 8).

(Fig. 8)

10. Add another task “Export Solution” (refer Fig. 9).

(Fig. 9)

11. Once the Build Pipeline is completed, click on “Save and Queue” to test the Build Pipeline (refer Fig. 10).

(Fig. 10)

12. Click on “Save and Run” (refer Fig. 11).

(Fig. 11)

13. Once the Build Pipeline is executed successfully, the CRM Solution is exported and stored in the Artifacts folder (refer Fig. 12).

(Fig. 12)

Release Pipeline

In the Release Pipeline, we will import the solution which was exported using Build Pipeline and stored in the Artifacts folder.

We must follow the below steps to create the Release Pipeline.

1.    Browse the Azure DevOps environment.

2.    Select the Project.

3.    Navigate to Releases and click on New Pipeline (refer Fig. 13).

(Fig. 13)

4.    Select the “Empty Job” (refer Fig. 14).

(Fig. 14)

5.    Rename the Stage name (in my case “Dynamics CRM Destination Instance”) (refer Fig. 15).

(Fig. 15)

6.    Click on “Add an Artifacts”, select the Build Pipeline and click on Add (refer Fig. 16).

(Fig. 16)

7.    Configure the “Continuous Deployment Trigger” (refer Fig. 17).

(Fig. 17)

8.    Add a new task “Import Solution” and configure the connection string to the Dynamics CRM Release Pipeline and click on Save (refer Fig. 18).

(Fig. 18)

9.    Click on “Create Release” button and configure as mentioned in the screen (refer Fig. 19).

(Fig. 19)

10. Select the newly created release pipeline and click on Deploy (refer Fig. 20).

(Fig. 20)

11. If all the configurations are correct, the Release Pipeline is executed successfully (refer Fig. 21)

(Fig. 21)

12. Once the Release Pipeline is executed successfully, the CRM solution is imported successfully into the CRM destination environment (refer Fig. 22).

(Fig. 22)

Hope this article helps to implement Ci/CD for Dynamics 365 CE using Azure DevOps.

No comments:

Post a Comment

Portal user scope level - Dynamics 365

  In Dynamics CRM (now Dynamics 365), a "portal user scope level" refers to  the level of access a user has within a portal , whic...