How to Automate MS Dynamics 365 code check-ins to Azure DevOps Git Repo

Mustaque Ehiya
2 min readJul 30, 2021

--

Every challenge is an opportunity for us to learn and improve. One of my professional mottos.

We recently moved to a new development process for MS Dynamics 365 project from what we had been doing earlier — from TFVC to Git Repo, creating CRM patches and branches for each work item, and related build and release pipeline changes

The new ALM tool was not working for all the developers due to firewall issues and other unknown reasons. It created a dependency in the team and also slowed down our productivity.

As a process champion, I strongly promote automation at every step as much as possible, and there was an opportunity here.

After understanding how the ALM tool was working, able to list down the required action items.

1. Create a CRM patch

2. Export the patch file

3. Work with Git repo (create a new branch, add files, commit and push to ADO).

4. Merge the changes into Main with Pull requests

I always wonder how IT would really work without Google!

I started with the favorite Powershell to explore the options for our blockers and after googling around, watching youtube videos, reading blogs, I could automate all the required steps and left a few processes as a manual step for developers to do validation check before triggering the ADO pipelines.

Sharing the script files for you to use as a template for MS Dynamics Check-in automation which includes steps for the below.

  1. One-time PS modules installation
  2. Create MS Dynamics 365 CRM patch
  3. Export the CRM patch and extract the components
  4. Create a Git Branch and move all the new files to stage, commit, and then push to ADO.

As part of Git Configuration, you also need to do the below setups.

  1. You need to install “Git on windows
  2. Update the global username and email with Git Bash.

$ git config — global user.name “Your Username”

$ git config — global user.email “youremailID@medium.com”

3. Clone the ADO GIT repo and create a local workspace.

This process improvement eliminated the dependency on the new tool and also other resources for deployment. Now every developer can release their Dynamics changes efficiently from their workspaces.

Happy Process Automation!

--

--

Mustaque Ehiya

Senior T-Shaped Professional, Passionate learner, Power Platform Architect, Dynamics 365 CRM, Program Management, Agile Delivery, EPMO & Digital Transformation.