This is the third post in a series discussing automated releases for Dynamics AX 2012 with ReleaseManagement for Visual Studio 2013. Before, we discussed the following topics:
- Part 1 discussed the pros and cons of ReleaseManagement and gave a glimpse on how we would fit in Dynamics AX.
- With part 2 , a first tool was created. This gave an overview of the central PowerShell module and explained the use of tool wrappers.
In this post, I wanted to tell you all about setting up servers, environments, paths and so on, but this is already well documented in the user’s guide. Also for AX, this does not differ from other products. (http://download.microsoft.com/download/2/9/B/29B10D38-3473-4AC2-9CEB-7D471E0A8ECD/Release%20Management%20for%20Visual%20Studio%202013%20User%20Guide.pdf) (Sorry for the links in here, but WordPress is bugging me with some issues in the editor :))
Instead, let’s focus on the AX specific parts. More specifically:
- Component configuration
- Release Template configuration
- Deployment sequence
Components can be seen as logical parts of a solution. This can be a database, a website, … These components can be configured in RM and you can assign deployment tools to them, link them to sources, … For Dynamics AX, we state that the component is comprised of the set of models or model store in the build output.
So for us, the configuration of an ‘AX Component’ is pretty straight forward. We create a component “AX2012Solution” and there are 2 things to configure: Where are your component sources and how do we deploy these source to the agents?
First, we define where the component sources are located. There are 3 options here:
- Builds with application
This links the component to a TFS Build definition defined in the release template. By doing so, RM knows what build drops to take and use these as the source for your deployment. So different release templates can be attached to different definitions. We use this when branching environments.
- Builds independently
In short, this is the same as the first option, but the build definition is linked to the component and not to the release template.
- Builds externally
Use this when you have no access to TFS from you deployment machines. You are able to have ‘offline’ source available in a folder.
In our case , this is linked to TFS through the release template.
Next, the Deployment tab is up. Here we’ll tell RM how to deploy the selected resources to the deployment agents (the machines involved in your deployment). And for AX, we can use the XCopy deployer here. Why?? Because we can use it to simply copy the sources from the build output folder to a known variable (__installationPath__) within RM. From then on, we can use that variable in our release template.
Release Template configuration
Next, you need to create a release template. This is when all of the pieces fall together. Start of by selecting the properties of your template. There you can specify the release path to be used. All of the stages in your path will result in a tab on your template. So it is possible to have a different deployment sequence for the different stages.
The second important thing here is the connection to the TFS Build definition. When you specify a build definition, RM will be able to present a list of recent builds when starting a new release.
And now, the magic of the whole thing! Putting together a sequence of actions that define your release. In the sequence editor you can see the following:
- At the left side, the toolbar containing your servers, components and inventory (tooling)
- Top right, you can see a tab for each of you stages in the release path. (To be able to have deployment template per stage)
- In the main area, you can drag and drop your action to the canvas. Depending on the action, you can input the parameter values needed.
So you can start of by dragging actions and composing your deployment. There a few rules here to keep in mind.
- Actions run on a certain server, so you have to start dragging the machine you want to use first.
- Your component is also available in the toolbox, so you can use your component shape to copy the build sources to the corresponding server.
Below, you can see a part of the deployment sequence and how it all falls together. The Install AX model action will collect parameters and pass them on to the PowerShell wrapper tool. From there on, the central PowerShell module is called and parameters are passed.
There you go! I hope this has shed some light on how to configure you deployment sequence for AX. In the next post, we will take a look at starting a release and how we can follow up deployments. After that, we should also take a look into the TFS Build template to trigger RM releases from within TFS Builds.