Jul 182012
 

The series so far:

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 (this article)

Introduction

Following on from an earlier series of articles on TFS Azure comes this update.  Recently, Microsoft integrated cloud-based build controllers to streamline the process of getting your automated builds online.

This is an excellent alternative to having to procure and configure your own on-premise build machine, and means that you can create basic build definitions with little overhead.

Where we left off..

In the previous article, we had configured an on-premise build server which hosted and performed local build services for our TFSPreview TFS instance.  This was the only option in the initial release of TFS Azure as there were no cloud based build services available.

New Capability

I recently created a new TFS Team Project to allow some collaboration.  I’d been in discussions last month with local Microsoft TFS expert Grant Halliday, he’d mentioned that there was now a cloud-based build controller option available.

Today I uploaded a very basic solution comprising of a console application and a Unit Test project.  Adding the cloud-based CI capability was easy as pie.

Configuring Your Cloud Build Controller

Simplicity itself. 

1. Once you have a valid solution in source control, simply right click on the Builds item in your Team Explorer and select “New Build Definition”:

image

2. Give your new build a name:

image

3. Configure the build trigger (notice all the regular options exist):

image

4. Next, set the build workspace(s) as per normal:

image

5. This is where it gets interesting.  You configure the build defaults, but there are some interesting options when using the cloud-hosted build controller:

image

Note that “Hosted Build Controller” is in the list of controllers available.  There is also an option which checks build output into source control (no need for a build share!)

6. There are also much the same options for the build process as you’d expect with an on-premise controller – and you can add your own build definitions as per normal.  Note that there is a new definition here also – “AzureContinuousDeployment” which we might touch on in another article.

image 
:

7. Once you’ve set your retention policy, you are good to go.

image

Executing a build

Treat it like any other build controller/build host!  You can manually execute or (if you’ve configured gated check-ins or CI build definitions) just make some changes and commit.

image

You can even watch the building process in real-time, just like a non-Cloud-hosted build controller:

image 

Summary

Couldn’t be easier!  Obviously, if your build process or solution require any special steps you may hit a wall with the hosted build controller.  This capability though, might be useful for selected branches of a large solution in which you wished to place gated check-ins/continuous integration, where the output is unit testing + classes.

All I can say is – this is a step in the right direction.

Sep 252011
 

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  
Sep 192011
 
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 on from Part 1, we’re taking an early look at TFS Azure, Microsoft’s first service offering of Team Foundation Server backed on top of the Azure Cloud service.

The Continuing Saga

By now you have probably registered with TFSPreview.com and created an initial Team Project.  Using the same Windows Live credentials, now we’ll look at connecting to and consuming resources from Visual Studio 2010.

I’m assuming that you already have Team Explorer installed (if not, you’ll need it) and that you’ve applied Visual Studio 2010  Service Pack 1 and the KB Hotfix.  I encountered a plethora of issues getting the hotfix applied, but hopefully you will have had less issues.

Connecting and Authenticating

Start Visual Studio 2010 and, once loaded, go to Team (Menu) –> Connect to Team Foundation Server.

Since this it the first time you’ll be connecting, click on the Servers.. button, and then click on the add button in the next dialog.  Use the URI listed on your TFSPreview administration page (in the form .tfspreview.com">.tfspreview.com">.tfspreview.com">.tfspreview.com">.tfspreview.com">https://<yoursite>.tfspreview.com):

image image

If all goes well, you’ll get an authentication page pop up and ask you to select the federated security model of choice (as of writing, only Live IDs are supported).

Selecting the default provider, we’re taking to Live to sign in – use the same credentials you registered your TFS service with (for best results).  You can create or assign other IDs later on.

Once authentication is complete, you should find your server has been successfully added to the list of TFS servers.  Select your server and you should be prompted with the available Team Projects:

image image

Victory is Mine

Once opened, Team Explorer should populate as if the TFS service was not cloud based, which means we should be able to use TFS more or less as we would normally, i.e. source control, work items etc..

image image

Limitations

A few things to note, from my first glance:

  • No Team Portal (SharePoint) or Team Web Access
  • Team Members (from TFS Power Tools) doesn’t seem to work/populate
  • No Reporting (SSRS)
  • No Process Guidance
  • Can’t create a new Team Project from inside Visual Studio:

image

    • You’ll need to create Team Projects from the browser/admin site
  • Group Membership/Security is managed via the website, even if you use the context menu in Visual Studio

Next Steps

In the next part, we’ll add a sample solution and define a build controller, and define a build definition or three, and see how well TFS responds.  We’ll also allocate some extra users, and play with permissions, groups and work items.

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