Moving Configurations and Master data records from one environment to another is a tedious task. In today’s blog I will provide step by step guide to automate this process using Azure DevOps.
These steps can be added as part of main pipeline which we use to automate CRM solution deployment.
To demonstarte this use case, I have added custom entity State in my source environment and added Name & Code fields into the entity. I have also created two records in it which I will move to Target Environemnt using Azure Devops pipeline.
Step 1: Create Schema with the help on configuration migration tool which is available in SDK. This is one time job which will have definition of what entities and fields for we need to move data to target environment.
Step 2: Click Continue, Login to CRM Source Environement and Sellect entities and fields. For demo purpose I have selected State entity and two fields.
Step 3: Click Tools and set settings to update records in Target environment based on some fields data. I have selected name field to be used for Update.
Step 4: Click Save and Go to File and Click Save Schema.
Step 5: Login To dev.azure.com and Create new repository and upload exported schema file into it.
Step 6: Create new pipeline and add below tasks as per screenshot below. For Export Configuration Migration Data provide below fields value
- Schema File – Select file from repository which we have uploaded in step 5
- Data FIle – Select as per screenshot. This is to place the exported data from CRM using Schema file
- Connection String – Provide connection string in below format for your source environment
Step 7: Add Publish Artifact task to publish the data.zip file to Azure pipeline Artifact which will be used in Release to import data to Target environment
Step 8: Once completed. Click save and queue. Verify if data.zip file is published to Azure pipeline Artifact.
Step 9: Now go to Release and Create new Release. Select Artifact in Release.
Step 10: Go to task and add below task as shown below to import configuration data to Target environment. Use Target Environment Connection String for below tasks. Select data.zip in data File option.
Step 11: Run this release and see if records imported to target Environemnt
Keep Exploring Power platform!