Team Foundation Server in the Cloud (Part 3): Builds, builds, builds

Part 1 Setting up TFS Azure
Part 2 Configuring Visual Studio to use TFS Azure
Part 3 Registering Team Build controllers for TFS Azure
Part 4 Builds in the Cloud

Introduction

Continuing from Part 2, now that we have the essentials set up, we’ll take a look at how to utilize the full functionality of Team Foundation Server Azure.

Before we get too deep into the article – this from Microsoft:

5. Unable to configure a TFS 2010 build agent/controller

Unfortunately, the TFS 2010 build agent and controller is not compatible with the Team Foundation Service Preview. You’ll need to use the build server software that is part of the Team Foundation Server 11 Developer Preview. You can find information about that release here.

You’ll need to install a facet of the Team Foundation Server 2011 Developer Preview in order to configure a Build Controller and Agents.

Microsoft® Visual Studio® Team Foundation Server 11 Developer Preview is the collaboration platform at the core of the Microsoft Application Lifecycle Management suite of tools, which helps teams be more agile, collaborate more effectively, and deliver better software faster.

Anyhow, you’ll have to download the installer (choose from Web Installer, .iso or self extracting EXE).  you could start downloading while continuing reading this article.

TFS Preview invite codes

I’ve had a few readers contact me in regards to invite codes for TFS Preview.  AFAIK, I was able to help them all out; and I have a couple of code/activations (2-3) left. 
So if you haven’t received your own activation code yet, and want to get started ASAP, drop me a line and I’ll send you one of the last codes I have which still has activations available.

Continuing Along

So when we left off, we’d configured Visual Studio 2010 to connect to TFS Azure, but now it is time to consume TFS Azure by using some of the functionality available.  I’ve got a sample solution that I’ll be writing about and publishing in a later series of posts, and I’ll be using it as a guinea pig (test) of TFS Azure’s service.

Open the solution you’d like to manage under TFS Azure, connect to your TFS Azure account (follow steps in Part 2), and then add your solution to Source Control as you would for a normal solution.  I prefer to add my solution structure to the source control directory before opening the solution.  This makes it easier to bind.

You can check your bindings, you should be able to bind:

binding

Now, once the solution is opened, you’ll see that the files are pending in the source control window:

source tree

As a good developer always does, I’ve run my Unit Tests and ensured that everything is peachy:

UnitTestsPass

Now that everything is ready, I’ll commit my changes to the Cloud!

commit

Assuming all goes well, you commit should work successfully, and your solution is now hosted and bound to TFS Azure.

Building

Configuring automated builds, however, pose a tougher problem to solve.  First, I tried to create a build definition myself, as I would with TFS 2010.  I navigated my way to the Team Explorer window and right clicked on Builds and tried to create a “New Build Definition”:

create build

This was met (predictably) with the following (somewhat unhelpful) error message:

“TF225001: Creating a build definition requires a build controller be defined for this team project collection.”

controller

As mentioned earlier, and according to this known issues page – you’ll need to install the Team Foundation Server 2011 Developer Preview to define build and a build controller.

So, whilst we’re sitting pretty without our solution bound to source control, we can’t create continuous integration or other automated build definitions.  A pickle.

Configuring a TFS 2011 Build Service

I’ll be the first to pose this question – what’s the point of Team Foundation Server Azure (in the Cloud) if build controllers and build agents don’t also sit in the cloud?  It seems totally redundant to me, to go to the hassle of binding to Azure if I must create and maintain my own build controller and agents in what amounts to off-cloud hosting.

It is my hope that this is rectified sooner or later.

Nonetheless, moving on..

To set up a build controller/agent you can follow along here, watch Richard Hundhausen’s video or read BHarry’s post here.

Install

Once you’ve downloaded and mounted the TFS 2011 Developer Preview image, you’ll need to run the TFS Server install.  I realise that a separate installer for the build parts would be *far* more convenient, but you have no choice in the matter, it seems:

install

Once the variety of prerequisites are preinstalled (including the ominous copying  of installers to the dreaded “installer cache” you’ll be prompted with the following screen:

image

Configure Your Build Server

Since we’re only interested in the Build Service, select it from the left hand tree, and then click on “Start Wizard”.

Once you hit the welcome page, click “Next” ton configure your Build Service installation.  On the second page you’ll have to select your Team Collection, you do this in much the same way as from Team Explorer (refer to Part 2 for details).

imageimage

image

Once connected, you’ll notice that there are no build controllers.

Clicking Next, we’ll accept the default, and have a build controller and single build agent created for us.

image

image

On the next page, we’ll be prompted to provide credentials for the Build Service to run under.  Note that you can change the default port that the service will use to communicate with TFS Azure (9191 by default).  You might want to ensure you’ve opened the port with your firewall (or other systems).  Don’t forget to click on the “Test” hyperlink to authenticate the credentials you’ve supplied.

Also note that the service will use the Windows Live credentials you specified when you connected to the Team Collection, earlier in the configuration steps, not the credentials you specify now, to connect to TFS Azure.

image

Our final page is the configuration summary page.  Once satisfied that your configuration is correct, press the Next button:

imageimage

Once the checks have completed, click on the “Configure” button..

imageimage

Once finished, you should get (hopefully) all successes.  Your Build Controller is now registered with your TFS Azure account.

image

Finally – A Build Configuration

Now that we’ve configured a Build Controller.. we can return to Visual Studio 2010.  I refreshed my Team Explorer, then right clicked on the Build item and selected “New Build Definition”.  This time, a different result – success.

imageimage

Now I can configure my build as I normally would.  For my first build, I’m not going to bother with a drop folder, so I unchecked this option (above) and also in the Process configuration:

image

Building

Now I’ve saved my build configuration, I’m going to run a test build.  I right click on the build definition and select “Queue New Build”:

image

image

My initial build built, but failed the unit testing.  This was caused by one of the tests which launches an interactive WinForm.  Commenting out this form, and checking in, triggers the automatic Continuous Integration build.  With luck, everything passes the second time:

imageimage

Returning to our browser, if you log into your TFS console, ensuring you aren’t in the Administration section, you can browse and see the build history now:

image

Conclusion

TFS Azure represents a tantalizing option for teams to share their workspaces and automated builds, but until Build Controllers and Build Agents can be hosted in the Cloud too, build services are a major weakness.   It is also somewhat disappointing that the Build Server software isn’t packaged and made available as a separate installation package (less than 1 GB).

That said, I had no trouble at all in configuring the Build Service 2011 (Developer Preview) and the whole process from Visual Studio 2010 to TFS Azure to Team Build worked seamlessly the first time through, with no errors or installation show stoppers.

In the next article, we’ll look at some ways we can customize the build as well as set some more meta data, such as Areas/Iterations and team security settings.  We’ll also look at how we can link build definitions into our work items and how the registered builds play a part in our overall SDLC.

Check out http://www.tfspreview.com for more information, or the community message boards located here.

Part 1 Setting up TFS Azure
Part 2 Configuring Visual Studio to use TFS Azure
Part 3 Registering Team Build controllers for TFS Azure
Part 4  

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

7 thoughts on “Team Foundation Server in the Cloud (Part 3): Builds, builds, builds”