Using BTDF for an unattended TFS 2008 Build/Undeploy/Deploy/Run Unit Tests

Topics: General Questions
Aug 10, 2010 at 3:49 PM
Edited Aug 10, 2010 at 3:58 PM

Hi, I have been experimenting with the BizTalk Deployment Framework and I am looking for some guidance getting the following unattended build/deploy scenario to work.

 I am working with the following setup.

Server 1) TFS Server -> TFS 2008

Server 2) Development Machine -> BizTalk 2009, VS 2008, BTDF

Server 3) Build Machine -> BizTalk 2009, VS 2008, BTDF , TFS Build Agent installed and working

What I would like to do, is to kick off a nightly build and deploy on the Build Machine (Server 3) (from BTS projects checked into TFS from Development machine Server 2). Once the unattended Build and Deploy have completed, then run some Bizunit Tests.

I have installed the BTDF on Server 2) and Server 3).

On Server 2 (Development Machine) I have:

a) Added a "Deployment Framework for BizTalk Project" to my BizTalk solution

b) Edited the generated BTSProject.Deployment.btdfproj. (that was added from step A).

c) Successfully invoked menu choice "Deployment Framework for BizTalk -> Deploy BizTalk Solution" from Visual Studio

d) The BTDF then undeploys/deploys my BizTalk Solution, starts it etc.

The BTDF works great!

I am now, trying to get the BTDF to do the same operation on Server 3 (Build Server), via a TFS unattended Build. What I have done is:

1) Created a Build for my BizTalk Solution, that gets invoked on my Build Machine (Server 3).

2) The generated TFSBuild.proj (generated from creating a TFS Build), basically just compiles and drops the generated BizTalk Dlls into a drop folder.

What I would like to do (after the build is done), is to then undeploy the existing BizTalk Application and then deploy the new one from the build, then run some BizUnit Tests. The documentation (pdf for BTDF) does mention this briefly as below:

You may wish to use MSBuild to kick off full unattended builds for nightly builds or continuous integration systems (like Team Foundation Server Build or Cruise Control). Since Visual Studio 2005 is the only supported way to build BizTalk 2006 projects, this part of your MSBuild build file must defer to calling Devenv.exe in command-line fashion. The included sample assumes that any infrastructure for unattended or continuous builds will be done in a distinct MSBuild file, and is not discussed here.

My first question is it possible to take the generated contents of: SomeName.Deployment.btdfproj and incorporate this into the TFSBuild.proj, for the build server? Then the unattended build would then do a undepoly/deploy after the build

I also did see a sample TFSBuild.proj. Should this file be used for the basis to get the automated build running on the build server? I have seen a previous post where someone did get my scenario to work.

Does anybody have any tips/sample TFSBuild.proj to get my scenario to work?


Aug 11, 2010 at 5:57 PM

After building the solution under TFS Build, you'll want to call MSBuild on the .BTDFPROJ file to create the server MSI.  See the BuildReleaseMsi.bat file in your Deployment project folder for the syntax.  You will probably need to set the MSBuild property CustomizableOutDir to true to keep Team Build from changing the file output paths.  You should not need to include any Deployment Framework MSBuild artifacts directly into your TFSBuild.proj.

At that point, your automation will be much like that described in this thread for actually deploying the MSI from the build.

The included TFSBuild.proj came from a working example, but I have not personally tested it.


Aug 11, 2010 at 7:51 PM

Thanks Tom,

Will give it a try.