In the previous post you have seen how you can create a CRM Deployment Package that contains your solutions and data. In this post I will build upon the previous build definition to add the capability to deploy your package to a target CRM environment.

Since my package contains everything I need including dependent Solutions and reference/configuration data, I will also configure the build definition to run a series of tests at the end of the deployment to verify that deployment was successful and the functionality is working as expected.


The build will utilise the CRM Package Deployer PowerShell extensions behind the scenes to achieve this. You can find more information on this in here.

Before you can create a build definition to do this, You will need to follow the steps in this link to register the Package Deployer PowerShell Extension on the TFS Build Server.

Follow the steps below in addition to all the steps that were required to created the “SampleExportPackage” build definition. In this case I will just clone and then extend the previous build definition.

Steps…

  1. Enter a name for your cloned build definition
    image
  2. Since we configured most properties in the “SampleExportPackage” we just need to make some slight changes to the Deployment section below.
    image
  3. Provide the connection details to your target CRM environment. More information about parameter values for different types of CRM Deployments can be found here.
    image
  4. Set the below to True to enable the deployment otherwise this section will be skipped.
    image
  5. Provide the Package name which will be the assembly name of your package that was compiled during the build.
    image
  6. That is all you need to do. Save the build definition and queue a new build.
    image
  7. This build will take slightly longer. If everything goes well, your build should complete successfully.
    image
  8. If you check the diagnostics logs now, you should see execution logs of the Package Deployer as well.
    image
  9. If you have any Unit or Integrations Tests, Your build can execute these after your package deployment and you should be able to see the results as per below.
    image
  10. Now you should have a build definition that is Build, Deploy and Test your CRM components.

Last edited Aug 5, 2014 at 7:38 PM by waelhamze, version 4