End to end TFSBuild pattern for BizTalk 2009, part 1 (Environment)

If you read my earlier blog post about a mysterious error from BTSTask you already know that I’m currently helping a customer with automated TFS 2008 builds for BizTalk 2009, if you haven’t read my earlier post here’s your chance.

Environment

Firstly you’ll have to setup some sort of build server and there’s at least 3 ways you can do this:

  • Have the build server installed separate from the “build BizTalk server”
  • Have the build server start a virtual snapshot of a “build BizTalk server”
  • Have the build server installed on the “build BizTalk server”
  • ???

I typically skip the first option because it usually end up in me having to write some kind of remote execution scripts (PSExec) or starting the scripts with timer jobs. Either way the overall build pattern turns out more complex than it needs to be or managing the build (yes you will be managing your builds) will be harder.

The second option would be the top choice for me if the customer has TFS 2010 and Lab Management in place. I know there are virtualization options for TFS 2008 but I’ve never user them myself.

So this leaves my with the option to have the “build BizTalk server” and the build server on the same box which makes it a lot easier.

Remember that you’ll need to install and configure the BizTalk server and remember to install/configure these options during the installation of the BizTalk server:

  • Developer Tools and SDK
  • Additional Software / Project Build Component, build component used by TFSBuild.

When the BizTalk server is installed and configured you’ll need to make/configure these options:

  • The service account for TFSBuild need to be added to the local Administrators group, required to install/uninstall assemblies to the GAC.
  • The service account for TFSBuild need to be added to the BizTalk Administrators group, required to use BTSTask operations.

As a common practice I always create a Hello World build type to test that my build server is working correctly before moving on with any advanced build patterns with automatic deploy for instance.

Hope you’ll enjoy this first part of the series!

Hugo

Mysterious error from BTSTask.exe

So I’m currently working with a customer/partner that needs some help with building, deploying and testing BizTalk 2009 applications with TFS 2008 (other post will describe that solution) and as usual I start off in my own virtual environment where I test building, deploying and testing before I deliver the builds to the customer.

Anyway everything is working exactly like my own environment until the build script hits the “export BizTalk 2009 application as msi” section. I get this funny error message:

BizTalk Server Deployment
Error while exporting application  <my application> into MSI package. Function failed during execution…

So the first thing I try is running the same command that TFSBuild just ran in my own Command Prompt, and of course it runs without any errors. So I start looking for stuff that differs between my account and the TFSBuild service account. I go through all the permissions and security groups without any luck. So I continue with my search in the TFSBuild log and find that the temp directory for the service account looks a bit strange:

C:\users\ <TFSBuild Service Account>\Tmp\…

Can you see the problem?

There was a space in the name for the TFSBuild service account and that made the ExportApp function of BTSTask to fail. The solution in my case was to set the environment variables TEMP and TMP to nicer paths like C:\Temp or C:\Tmp and the build worked.

So don’t use spaces in your account names because you never know what problems you’ll run into.

Cheers!

Hugo