Deploying BizTalk Applications with MSBuild

On virtually all our projects, there has been a need to perform additional tasks above and beyond simply "compiling" our BizTalk applications. I’m talking about all the numerous operations you need to carry out in order to be able to have a BizTalk solution up and running on a development workstation from source code.

Fortunately for us, MSBuild is a very flexible scripting tool specifically designed for customizing complex build processes. But, even though .btproj project files have been promoted to first-class MSBuild citizen, starting from BizTalk Server 2009, there is only so much Microsoft can automate for us. BizTalk solutions can sometimes be very complex and the most flexible solution is to rely on a set of discrete and focused MsBuild tasks to do the job.

In the past, deployment solutions suitable for use in a scripting environment have been far and few. You could rely on the infamous BtsTask.exe command-line utility; You could even use BtsControl.exe, a community tool designed to overcome some of its shortcomings. These tools are crude, but at least most MSBuild projects I’ve seen take good advantage of them, as well as DevEnv.exe, inside an <Exec> tag.

But that’s about it.

Today, I would like to talk about the various projects available from the community and that we came to rely on for our deployment needs with MSBuild.

  • Sdc Tasks Library

    This project was initially started by Microsoft UK and is now hosted on CodePlex. It now includes a very respectectable set of tasks specifically designed for BizTalk. This is what drives the majority of our build process.

  • BizTalk 2006 MSBuild Task(s)

    This small project contains tasks to work against BizTalk hosts and host instances.
    We haven’t used these because we never had a need to automate those artifacts as part of the build process. The goal of this project is obviously to supplement missing tasks from the Sdc Tasks Library.

  • MSBuild Biztalk Rules Engine Tasks

    This is a small project, also hosted on CodePlex. Its only purpose in life is to help manipulate the policies and vocabularies artifacts in BizTalk. It only contains a handful of tasks but these are essential since no matching functionality can be found elsewhere, as far as I know.

  • Biztalk Deployment Framework

    This is probably the most complete project with regards to automating the deployment of BizTalk solutions with MSBuild. I must admit that I haven’t looked at this project yet. I seem to recall that it relied almost exclusively on Nant as a build engine. Since it also now supports MSBuild, and appears to be very actively developed and maintained, I might give it a try!

An then, there’s the BizTalk Build Generator. This tool gets you started with the creation of your MSBuild scripts. In fact, it creates MSBuild project files from a specified, fully running, BizTalk solution. But even though you will probably not use its generated scripts as-is, you can use some very useful accompanying tasks for working with BizTalk hosts and host instances.

Now, with all things BizTalk, one never cease to wonder when the development ends and when the administration starts. I would tend to favor the use of Windows PowerShell for administration tasks and there’s definitely a lot of these operations performed while developing that fall into this category.

Hum, MSBuild vs PowerShell ! That might be the subject of another post !

This entry was posted in MSBuild. Bookmark the permalink.