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!

teamcity_azure

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.

azure-template-deployment

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

azure-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

Feedback

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!

This entry was posted in Features, FYI, News & Events. Bookmark the permalink.

14 Responses to The official TeamCity Azure Resource Manager template

  1. Eros Stein says:

    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

    • Dmitry Tretyakov says:

      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.

  2. Nikolay says:

    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?

    • Dmitry Tretyakov says:

      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. Kevin says:

    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. Dan Gilleland says:

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

    • Dmitry Tretyakov says:

      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.

      • Dan Gilleland says:

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

        • Dmitry Tretyakov says:

          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. Rob says:

    Executing

    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.

    • Dmitry Tretyakov says:

      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.

Comments are closed.