Journey to Implementing Continuous Delivery for Dynamics CRM

In this post I will show you how you can implement Continuous Delivery for your Dynamics CRM solutions. Using the latest version of Team Foundation Server (TFS), Visual Studio Release Management and xRM CI Framework you will be able to implement one-click automated deployments across all your environments including production. This will enable you provide continuous business value to your stakeholders by releasing small changes more frequently, consistently and reliably. This is very much inline with Agile methodologies of software delivery.

Stage 1: Automate your Builds

Before you can automate your deployment and release processes you need to have an automated consistent way of building your Dynamics CRM components. In terms of deployment your components will be artifacts like CRM Solutions, Configuration Data, CRM Deployment Packages and others. Team Foundation Server provides an excellent Build Automation and Continuous Integration Engine that you can use for this.

Using xRM CI Framework you can easily create automated builds for your Dynamics CRM solutions with a few clicks. Follow the documentation on codeplex to create your build. The build will generate your CRM components and place them in the designated drop location. This can now be picked up by your Release Automation tool which in this case will be Visual Studio Release Management.

Stage 2: Automate your Deployments

Having a consistent build process in place, you can now move into automating the deployment of the components produced above. You will use PowerShell scripts to automate the deployment process. The latest Sdk for Dynamics CRM 2013 comes with PowerShell extensions that allow you deploy CRM Deployment Packages.

The xRM CI Framework comes with two generic PowerShell Scripts. The first one allows you to import CRM Solutions and the second one allows you to deploy a CRM Deployment Package. Depending your scenario you can get started by using either of these scripts and tweak them to your needs. Note the xRM CI Framework also contains many custom PowerShell Cmdlets (Commands) that you can use in your scripts. Check out the documentation on codeplex for more information.

Now you should have some scripts that you can run on to deploy your automated Build outputs.

Stage 3: Automate your Testing

You should be really thinking about this from the start and writing automated tests as requirements come in. The reason I put this at this stage is because as far as Continuous Delivery is concerned you can’t execute your automated tests without having first build and deployed your application to your stage or testing environment. Ideally you want to run Unit Tests during each Check-In and Integration and functional tests in your Continuous Integration and Nightly builds. Finally sanity tests can be run after deployment to your UAT & Production environments.

The xRM Test Framework contains lots of utility classes and productivity tools to allow to easily create Unit and Integration Test for your Dynamics CRM deployments. Check out the detailed documentation and webinars on codeplex. These tests can then be executed during your builds and post your release using Visual Studio Release Management.

Stage 4: Automate your Releases

Once you have your automated builds and deployment scripts ready, you can start thinking about release automation. Release automation allows you to do one click deployments across all your environments. Visual Studio also includes cool features such as security, audit, configuration and environment management and most importantly an easy visual tool to allow you to model your release process using workflows.

In the following post I will show you on how to use Release Management with Dynamics CRM.

Hope you found this post useful.

 

Advertisements

Posted on August 25, 2014, in CRM 2013, xRM CI Framework and tagged , , , , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: