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.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
4. Create a Build Definition. It will export the Dynamics 365 solution from the Source environment.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
5. Create an empty job and click on the + button and add the task according to the order mentioned.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
6. Provide CRM Connection String.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
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.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
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.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click Add.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click Add.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click OK.
Add another task, i.e., Publish Customization as given below.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click "Save".
Test the operation
Go to build and click on the queue after the build is successful. Go to release.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
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.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Go and do the testing again, i.e., go to build and click on the queue.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click on Queue and go to the current build which is in progress.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
After Build is successful as given below, go to Release.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Click On Blue Icon; i.e., Target Environment
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
Go to the Target Environment.
![Export And Import Solution From One Environment To Another Using Continuous Integration And Deployment Using Visual Studio Team Services]()
The Source Solution is imported successfully into the Target Environment.