Features FYI News

The official TeamCity Azure Resource Manager template

We are happy to announce the Azure Resource Manager template for TeamCity. You can now deploy TeamCity to Azure cloud services and save time on configuration tasks. Get ready to start using TeamCity in several minutes!


Deploy TeamCity to Azure Cloud Services

The template performs the following tasks:

  • Setting up of an external database
  • Creating a virtual machine for the TeamCity server
  • Configuring the TeamCity server machine
  • Installing the TeamCity server
  • Installing a TeamCity build agent

Depending on your team size, you can select the appropriate TeamCity installation size for evaluation or production usage:

  • Small – suitable for small teams, typically 3 users, 100 builds/day.
  • Medium – suitable for medium sized teams, typically 5 users, 300 builds/day.
  • Large – is intended for large teams, typically 20 users, 1000 builds/day.

To get started, perform the following steps:

  • Specify the resource group name
  • Enter a public SSH key for the TeamCity server machine
  • Enter a password for the database
  • Click Purchase.


Wait for about 10 minutes and you will be able to navigate to the TeamCity URL received from the template outputs:


After opening the TeamCity page, you’ll need to accept the license agreement and set the root account credentials. Now you are ready to use TeamCity.

Configure additional Azure integrations

Your TeamCity server comes with preinstalled plugins which can be used to configure tighter integration with Azure services:

How it works

During the deployment process, the service allocates a Linux virtual machine. The VM is powered by CoreOS with Docker support enabled. It exposes port 80 for the web access and 22 for maintenance in the network security group, so you’ll be able to connect to it via SSH.

Configuration and data files are stored on the disk attached to this VM. The TeamCity server and build agent are started from the official Docker images.

An instance of the Azure database for MySQL is created with the teamcitydb schema. Network security rules are set to make the database accessible from the TeamCity server machine.

In the virtual machine, the TeamCity operation is controlled by the following systemd services:

  • teamcity-server.service controls the lifecycle of TeamCity server
  • teamcity-agent.service controls the lifecycle of TeamCity build agent
  • teamcity-update.service handles the TeamCity updates.

TeamCity upgrade

When a TeamCity VM is created, it has a teamcity-version tag. By updating its value, you can control the current version of the TeamCity server and build agent. After the update, you need to restart the VM entirely or restart the server and agent services via the following commands:

> sudo systemctl restart teamcity-server.service
> sudo systemctl restart teamcity-agent.service

Note: The update could take a few minutes to pull the new version of TeamCity Docker images.

How to diagnose problems

You can connect to the VM and use default systemd tools to control TeamCity services. For instance, during the upgrade you can view the server log using the following command:

> sudo systemctl status teamcity-server.service


Please feel free to leave a comment to this post or file an issue in the TeamCity issue tracker.

Run TeamCity on Azure

Happy building in Azure Cloud!

Comments below can no longer be edited.

14 Responses to The official TeamCity Azure Resource Manager template

  1. Avatar

    Eros Stein says:

    February 12, 2018

    I can’t quite understand the process. It’s requesting for the SSH Key Data on the template but as far as I understand that key can only be generated after its creation. I’m using the azure template. Am I doing something wrong or is it the process? Thanks

    • Avatar

      Dmitry Tretyakov says:

      February 12, 2018

      The public ssh key is required to setup access for virtual machine where TeamCity is placed. By leveraging private ssh key you will be able to establish ssh connection to it, so it could be considered as a “password” for VM. That’s why it is required to generate SSH key on your machine to specify public ssh key while TeamCity deployment.

      • Avatar

        Eros Stein says:

        February 12, 2018

        When you say on my machine you mean any machine but the virtual machine, right? I’m asking because it is the template that creates the virtual machine TeamCity will be placed.

        • Avatar

          Dmitry Tretyakov says:

          February 12, 2018

          Yes, ssh key should be generated on the different machine. And yes, this template creates virtual machine with TeamCity server and build agent as follows.

          • Avatar

            Eros Stein says:

            February 14, 2018

            Understood, thanks!

  2. Avatar

    Nikolay says:

    February 14, 2018

    I have AzurePack (standalone azure installation by msft) in my company. Can i use this ARM integration with my AzurePack or it’s available only for original Azure Cloud?

    • Avatar

      Dmitry Tretyakov says:

      February 14, 2018

      The problem is that Azure Pack does not include marketplace images. In this template as a base image used CoreOS, so if you could make it available in your Azure Pack and then tune image reference in the template it seems that you will be able to use this template for TeamCity deployment.

  3. Avatar

    Kevin says:

    March 26, 2018

    It is worth mentioning that Auto-updates are not supported with this template. This could be a game changer if you don’t know anything about the OS used by the template.

  4. Avatar

    Dan Gilleland says:

    April 8, 2018

    Two issues:

    1. Following these steps and choosing the “Pin resource to Dashboard” in Azure gets a “Deployment failed” result.
    2. Attempting to view your Issue Tracker as a guest fails (guest account does not have permissions)

    Pretty hard to figure out where to go from here. Any help would be appreciated….

    • Avatar

      Dmitry Tretyakov says:

      April 9, 2018

      Dan, thanks for reporting this case. I’ve updated the link to the TeamCity issue tracker, but anyway to report a new issue it requires to sign in.

      To understand what’s going wrong with deployment in your subscription you need to navigate to the target resource group -> Deployments -> “Microsoft.Template” and find the root cause of deployment failure. Then you could file a new issue in our tracker and specify the found problem in the issue description.

      • Avatar

        Dan Gilleland says:

        April 13, 2018

        Thanks Dmitry!

        The one thing I wish the template had was the ability to automatically include a Windows build agent (I’m building off of VS 2017). Currently, I’m thrashing about trying to get it set up from what’s written in your blog post on Apr 26, 2017.

        I must say, if a person hasn’t any network setup knowledge, it’s quite difficult to figure it all out (I have some, but I’m more of a senior developer, not a network admin).

        I’m not sure I can get it set up through Azure using the template, and I might have to just resort to making my own Windows VM that doubles as the build agent (with TeamCity’s built-in db).

        Further, in trying to navigate the maze, the costs look frightening (from as little as $20/month to thousands), and the “fear factor” gets quite high over all the manual setup for a developer on the Microsoft tech stack.

        I suppose I should raise this in the forum, but that’s just another point of disconnection in trying to “figure it all out”.

        • Avatar

          Dmitry Tretyakov says:

          April 13, 2018

          Dan, thanks for explanation.

          We’re trying to improve the UX for Azure cloud profile creation which allows to specify the list of cloud images. For that you could go the Administration -> Root project and create a cloud profile (manually or via project suggestion). There you will have a wide range of supported image type and deployments, where the easiest way to create a new cloud image is to use Container images, e.g. from jetbrains/teamcity-agent:latest-nanoserver docker image.

          But note, that containers is currently in preview version, so the recommended way is to use managed Image type which involves amount of work to create VM with required tools and then capture it.

          For configuration you could refer to the following wiki pages.

  5. Avatar

    Rob says:

    May 14, 2018


    systemctl restart teamcity-agent.service

    prompts for a password, but a password wasn’t set up during the provisioning process.

    Also, would it be possible to explain how to update the teamcity-version tag, or even read its current value? I’m a developer, not a Linux sysadmin. A lot of this territory is very unfamiliar to me.

    • Avatar

      Dmitry Tretyakov says:

      May 15, 2018

      Hi Rob, you’ve missed important part of the command – “sudo” prefix which will grant you required permissions without password. To change the TeamCity version number open Azure portal, navigate to the Resource groups -> %teamcity resource group name%, click on the “teamcity” VM and select “Tags” tab where you’ll find the “teamcity-version” tag.

Discover more