Let us see how to use Continuous Integration and Continuous Deployment to export and import a Solution from one environment to another using Visual Studio Team Services
Prerequisites
- Dynamics CRM Source and Destination environment.
- Visual Studio Online Account.
- Dynamics 365 Build Tools by Wael Hamze (written in PowerShell scripts to import and export the solution)
Steps to follow.
1. Create a project or repository in VSTS online (now known as Azure DevOps).
2. Click on the Repos.
3. Click on Initialize.
4. Create a Build Definition. It will export the Dynamics 365 solution from the Source environment.
5. Create an empty job and click on the + button and add the task according to the order mentioned.
6. Provide CRM Connection String.
7. Provide a solution name to export. You can even mention whether you need to export the solution as managed or unmanaged. Generally, for best practices, the solution should be exported as Managed.
8. Test the Build definition whether the solution is exported from the source environment or not.
Here, Description.zip is the solution name which will be exported from the Source and stored in the artifacts, i.e, the drop folder.
Create Release Definition
Here, we will need the artifact from the build definition.
Click Add.
Click Add.
Click OK.
Add another task, i.e., Publish Customization as given below.
Click "Save".
Test the operation
Go to build and click on the queue after the build is successful. Go to release.
The build will be unsuccessful because I have not added MS CRM Tool. So, go to Release -> Tasks and add the task at the top, as mentioned in the screenshot and save it.
Go and do the testing again, i.e., go to build and click on the queue.
Click on Queue and go to the current build which is in progress.
After Build is successful as given below, go to Release.
Click On Blue Icon; i.e., Target Environment
Go to the Target Environment.
The Source Solution is imported successfully into the Target Environment.