Continuous deployment with TFS 2010 Build Agent

When looking at Visual Studio Lab Management and how deployment are done I found this diagram.


If you look at the Virtual Machine 1 box inside the Hype-V Host box you find Build Agent. This is the same as Build Agent A.1 used on the Build Machine for doing “normal” builds as shown in this diagram.


This means that you can use the the TFS Build Agent to do continuous/automated deployment even if you don’t have the Lab Management parts.

How to set it up

To make it work you could set it up something like in the diagram below.


On the Team Foundation Application-Tier the build controller will delegate the different parts of the build and deployment to the different build agents based on the assigned tags passed to build for the different parts. This can be done by adding process parameters as described at the end of Jim Lambs post on How to Create a Custom Workflow Activity for TFS Build 2010 RTM

You have to modify your build workflow to do the deployment. To do this you add a AgentScope activity for every server you want to deploy to. In the AgentScope you add what ever workflow activity you need to perform the deployment. Below is a very simple example.


4 thoughts on “Continuous deployment with TFS 2010 Build Agent

  1. Brandon D'Imperio 2011-07-01 / 14:49

    I’m trying to figure out why there’s a ‘drop location’ used, it appears to me there are already 2 copies while building, then a 3rd to a drop location, then a 4th for deploy/publish?

  2. Håkan Forss 2011-07-01 / 16:25

    The idea is that you build one time on the build server. You then add additional AgentScope activites for every server that will only do what ever is nesasary to deploy, not compile code, on that server.
    The “Copy file from drop location” would only copy the files FROM the drop location of the build on the build server and deploy them on the target server. Is that more clear?

  3. Praneeth 2011-11-18 / 00:41

    How do I deploy them on the target server

    • Håkan Forss 2011-11-18 / 08:58

      You have to install the Build Agent on the target server. This is part of the TFS install

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s