Using Team Foundation Build for BizTalk projects (Part 1)

Listen with webReader
Published 13 August 08 06:48 PM | wmmihaa

I've been working in a fairly big BizTalk project since early this year, and wanted to share my experience working with Team Foundation together with BizTalk projects. The solution became more complex than originally anticipated. So hopefully you can learn from this, and maybe reuse some of the code and scripts I'll share in this series of articles.

But before we get into the details, let me fill you in on the requirements and challenges...

Easy and automated Deployment
  • We have five types of environments: Development (several), Build, Test, Acceptance and Production. We have about 30 BizTalk applications with a total of just about 300 ports on each environment.
  • We have normalized our BizTalk projects as much as possible, to reduce impact on redeployment, which left us with just over 200 Visual Studio projects. The amount of projects, together with its dependencies, would  make deployment quite challenging.
  • Each developer must be able to build and deploy their solutions, independently from other developers.
  • Due to the complexity of the environments, the deployment process has to be rigid or preferably automated.

Looking at Microsoft Team Foundation (from a far distance), it seems to be the solution to our problems. However, on a closer look there where many obstacles to overcome, before we'd get it to work.

Team Foundation Server

Team Foundation is a server product that integrates with products like MS Excel, MS Project and of course Visual Studio. This is accomplished through Team Explorer which adds functionality such as WorkItem Tracking and Source Control to these products.

Team Foundation also provide the functionality for Team Build, through which Build Managers can compile the projects, run associated unit tests, perform code analysis, release builds on a file server, and publish build reports.

 

The basic practice is this:

  1. Create a Visual Studio Solution with your projects, and check them in to the source control.
  2. Create a Build, and select your solution, along with the Build server to use.
  3. You may optionally choose triggers for when you want the Build to start. Useful for nightly builds etc.(only for Team Explorer 2008)
  4. Run the Build.

When running the Build, a Team Build Service on the selected Build server will get the latest code, label it, and build it. This is all done according the tfsbuild script that was created for you when you created the Build.

However...

Everything works fine unless, of course, you're trying to build BizTalk projects... As it turns out, Team Build is very similar to MS Build, and normal Visual Studio projects like C# projects, are just MS Build scripts. BizTalk projects, however, are not, and are therefor ignored by the build engine.

We didn't want to invest in Team Foundation 2005, but since we can only use Visual Studio 2005(VS 2008 does not support BizTalk projects yet), we had to use Team Explorer 2005, which gives less functionality. This left the Build Manager to have both Team Explorer 2005 and 2006.

Furthermore, there are no built-in support to deploy BizTalk projects.

Solution

To meet our requirements and utilize the functionality of Team Foundation, we had to start out by setting some design rules.

Since each developer must be able to build and deploy there solutions, independently from other developers, we had to group our projects in groups without dependencies to other groups. This was implemented by grouping the BizTalk projects in to ILS solutions. ILS is a term sometimes used in earlier BizTalk version and stands for Integration Service Layer. But in this case, it's better read as Isolated Service Layer, since there can be no references to projects in other ILS solutions.

Each ILS solution also included binding files for each BizTalk Application and environment.

A BizTalk project has by default two build configurations, Development and Deployment. We used these configurations to set the Target Environment (Development == (local), Deployment == Build server). Later on, when deploying the project through Team Build, we used the Deployment configuration. The actual compiling of each BizTalk project was done by DevEnv.bat rather than MSBuild. By using the /Deploy flag, we where able to build, deploy and create the BizTalk Application in one line of code.

"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv" "MySolution.sln" /Deploy "Deployment"

We ended up creating a handful custom build tasks, which we could use in our build script to:

  • Undeploy ILS projects, ports and artifacts
  • Build and deploy all ILS projects
  • Import Binding files to Build environment
  • Generate MSI packages for deployment in other environments with only the deployed artifacts and binding files.

This all led us to be able to be able to, through Team Build, build all ILS projects, deploy them to the build environment, label all sources and open up for an easy deployment for the other environments.

In the next article I promise to get into more details, of the solution.

Comments

# Mikael Håkanssons Blog said on August 18, 2008 08:26 PM:

In my last post I wrote about the requirements and challenges we encountered, implementing Team Foundation

# Jim Lamb said on September 29, 2008 12:11 PM:

We’ve been talking with the BizTalk Server team about supporting MSBuild (and, transitively, Team Build)

# Recent Faves Tagged With "biztalk" : MyNetFaves said on December 9, 2008 04:05 AM:

Pingback from  Recent Faves Tagged With "biztalk" : MyNetFaves

# Mikael Håkanssons Blog said on February 11, 2009 10:13 PM:

BizTalk Server 2009 comes with support for MSBuild. The question is, how can we use it, and how does

# Jim Lamb said on May 4, 2009 08:32 PM:

We’ve been talking with the BizTalk Server team about supporting MSBuild (and, transitively, Team Build)

# Websites tagged "biztalk" on Postsaver said on May 27, 2009 09:33 AM:

Pingback from  Websites tagged "biztalk" on Postsaver

# Dwight Goins said on July 3, 2009 03:50 AM:

Hey guys great post from You and Johan. Keep up the great work.

Great post just what I needed for a client of mine...

Maybe I'll be back there in Sweden soon enough.

Leave a Comment

(required) 
(required) 
(optional)
(required)