13 Apr 2014

20 Comments

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…

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.

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

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

TFSBuild_Scrn1

3. 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

4. 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

5. 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

6. 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

8. 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

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

TFSBuild_Scrn8

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

TFSBuild_Scrn9

11. 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

12. 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.

  • Patrick K.

    Are there any special network connections, ports, configuration required to allow communication between a local build controller and a VsOnline repository

  • Prabhu

    Hi,

    Is it needed to install TFS in order to configure Build service..? Since we already have TFS with projects in different server and we dont want to install TFS again in Build Server..?

    Please advice

    Prabhu.

    • Hi Prabhu,

      The installation of TFS components/services is a two phase operation. First the common files are installed and then the configuration wizard configures the necessary services for the role you want the specific machine to play.

      In the case of Build services, you need to install the common files (what you call installing TFS) and then when the configuration screen is shown you choose to configure the machine as a Build server. This configures the build service and configures the build controller and/or build agent for you.

      Rest assured you don’t then have multiple TFS servers as you have only configured the build services on the machine.

      There is no other way to install a build controller or build agent that I am aware of.

      I hope this answer helps.

      Cheers

  • Pingback: Visual Studio Online (TFS as a Service) – What you need to know to get started - Michael Pedersen's Blog - Site Home - MSDN Blogs()

  • Jochen van Wylick

    Hi Mr. Borton,

    thank you for your post! I did this yesterday and it worked kind-of like a charm! I’m just trying to get rid of some of the build warning I’m getting about missing reference asseblies. Installing Visual Studio on the machine probably solves all of the errros, but I’m doing down the road of copying all MSBuild + Reference Assemblies folders into the Program Files (x86) from my dev machine ( as described here: http://nickberardi.com/a-net-build-server-without-visual-studio/ ).

  • Pingback: Continuous Delivery with VSO: Application Deployment with Release Management - Please Release Me()

  • Pingback: RM: deployment naar on-prem target | Vincent()

  • Pingback: Local TF Build + VSO + Dynamics AX - Microsoft Dynamics AX Community()

  • Pingback: Build Server | Vincent()

  • Do we have to use TFS2013 as the build controller/agent or can we use TFS2010’s build controller/agents? What about Tfs2015?

    • Hi Brandon,
      I’ll need to check to see how well this may or may not work with TFS 2010. Given this version pre-dated VSO, You would likely need to use the forward compatibility patch. Not sure – will need to check.
      TFS 2015 is a very different beast. The new build automation system replaced the XAML build workflows and there are no longer any controllers. It is much easier to setup a hybrid environment using the new 2015 Agents and Agent Pools.
      Cheers

      Anthony

  • Gurmail Multani

    Please let me know, if our build succeed it automatically deploy to our LIVE web folder of server?

  • Gurmail Multani

    Please let me know, if our build succeed it automatically deploy to our LIVE web folder of server?

  • Sriram

    Hi Please let me know which account can I use to configure Build service If I don’t like to use Network service. If I want to use say domainTFSsetup account how can i proceed. Will this allow me to configure. And what Type of USer access(BAsic, MSDN subscriber) should I have in VSTS to connect to this on premise build server. does the user require TFS CAL also to connect to TFS build service?

    Thanks

  • Sriram

    Hi Please let me know which account can I use to configure Build service If I don’t like to use Network service. If I want to use say domainTFSsetup account how can i proceed. Will this allow me to configure. And what Type of USer access(BAsic, MSDN subscriber) should I have in VSTS to connect to this on premise build server. does the user require TFS CAL also to connect to TFS build service?

    Thanks

  • Sriram

    Hi. Is this scenario supported for latest VSTS and TFS .Because I have configured the same using TFS2015 Update1 media. But I am not getting my On-Premise controller in the XAML build definition.