Configuring on-premises Build server for Visual Studio Online

In this post I am going to walk you through installing TFS 2013 build services on a local (on-premises) server and connecting it to your Visual Studio Online account.

Before I get into it, I want to point out that Visual Studio Online (VSO) provides a great Hosted Build Controller that allows you to build your applications using an on-demand, dynamically provisioned virtual machine running on Azure. So why would you want to use your own build server if one is so easily available to you in VSO? There can be quite a few reason including:

  • You want to use VSO for your development team but need to deploy your application inside your organisation
    • You require additional software installed to build your software and it can’t be installed as part of your build on the VSO build servers.
      • You want to use the command line tool available in Visual Studio Release Management 2013 Update 2 RC to integrate Release Management with VSO.
        • and much more…</ul> In addition to the following instructions working for an on-premises build controller/agent, you could easily follow these instructions to create a build controller/agent using an Azure Virtual Machine.

        BEFORE WE BEGIN

        • I have already installed a new Windows Server 2012 R2 with Update machine on my Hyper-V host. It has 4Gb of memory allocated for now which should be fine for the builds I am likely to use on this machine.
          • I have run Windows Update and applied all available patches.</ul>

            INSTALLING BUILD

          1. We’ll start by mounting the TFS 2013 with Update 2 ISO on our new virtual machine and running tfs_server.exe to kick off the installation.

          Run_TFS_Server

          1. In the following splash screen, you’ll need to accept the license terms then click Install Now.

          TFSBuild_Scrn1

          1. Once the files have been installed on the server, we’ll select Configure Team Foundation Build Service in the Configuration Center and click Start Wizard.

          TFSBuild_Scrn2

          1. Once the Build Service Configuration Wizard starts, decide if you want to help improve the setup experience by sharing data with Microsoft and then click Next.

          TFSBuild_Scrn3

          1. The next thing you need to do is connect with you Visual Studio Online account and you’ll see a single DefaultCollection in the list. Click Connect.

          TFSBuild_Scrn4

          1. After connecting to the VSO account you’ll see there are no build controllers or build agents already configured. Click Next.

          TFSBuild_Scrn5

          7. By default the wizard will suggest one build agent per CPU core. As you see below my virtual machine has been configured with just one processor core. I’m happy to have the build controller plus a single build agent installed, so we’ll go ahead and click next.

          TFSBuild_Scrn6

          1. You need to choose what account you would like to run the local build services with (Eg. Network Service or TFSBuild) and then choose the Account Service for connection to the Hosted TFS Server in VSO. Click Test to ensure the account(s) you have selected are valid and then click Next.

          TFSBuild_Scrn7

          1. Review the settings you have selected and correct any mistakes by clicking Previous. If everything looks OK, click Verify.

          TFSBuild_Scrn8

          1. The verify process should report all tests have passed. Correct any issues then click Configure.

          TFSBuild_Scrn9

          1. If you’ve configured everything correctly, you should see the following screen indicating your on-premises build services have been installed and configured. Click Next then Close.

          TFSBuild_Scrn10

          1. Now when you create new build definition in Visual Studio, you should see both the Hosted Build Controller (from VSO) and the newly installed on-premises build controller.

          TFSBuild_Scrn11

          Good luck with your on-premises Build Controller. In an upcoming blog post I’ll walk you through how to configure continuous release using your on-premises build server and Release Management for Visual Studio 2013.