FYI News Partners

TeamCity on Azure Marketplace

Some time ago we announced TeamCity Azure Resource Manager for TeamCity deployment in Azure cloud. Now we’re glad to provide the TeamCity offer in the Azure Marketplace for streamlined TeamCity setup.

It is also available as a TeamCity download option on the official JetBrains site:

teamcity-site-deploy-2-azure

The offer lets you run a JetBrains TeamCity server and a local agent on an Azure Linux VM in Azure.

Today we’ll go over a TeamCity instance setup on Azure, which will save you time and effort of configuration tasks.

Prerequisites

You’ll need an Azure subscription and about 10 minutes to set up TeamCity.
Note: Make sure you have a contributor and user access administrator roles on Azure.

Installation

Most of the TeamCity installation is automated, all you need to do is perform a few steps:

  1. Log in to the Azure portal.
  2. In your browser, open the TeamCity offer in the Azure Marketplace.
  3. Select GET IT NOW
  4. Review the pricing and terms information, select Continue.
  5. Select Create at the bottom of the page to configure a TeamCity installation.
  6. Configure settings:
    1. In the Basics tab, create a new resource group, in our case teamcity_demo:
    2. Configure Virtual machine settings: provide the username and authentication type. The recommended approach is to use SSH key for that. Password authentication is not recommended due to the known issue with CoreOS metadata service which breaks the startup of the default build agent. The Domain name label, DNS Prefix for the TeamCity server, will be auto-filled for you. If editing it, make sure it is globally unique.
      At this step, you also need to configure and save the subnet settings. Click OK to save the Virtual Machine settings.
    3. On the Additional Settings tab, select the TeamCity installation size and provide a password for the MySQL database of your TeamCity instance.
    4. Review the summary on the next screen. If required, download the template and parameters on your local machine for future use. Go on creating the TeamCity instance by clicking Ok.
  7. Review the privacy policy and if you agree, proceed by using Create. The deployment in progress message appears and you can click on it or the notification icon at the top to review the progress. The Operation Details link can be useful if an error occurs.
  8. Click Refresh. Upon a successful installation you’ll see the TeamCity URL name in the deployment Outputs tab:
    teamcity-outputs-DNS

That’s it! Now you can use the URL to access your TeamCity instance: you’ll need to accept the license agreement and set up the administrator account credentials.

You are ready to use your TeamCity installation, which includes the server and one local agent. See the TeamCity Quick start guide to configure and run your first build.

You might also want to expand your installation and make it more flexible by performing a couple of additional steps.

Adding Azure agents

Your TeamCity setup includes a TeamCity server and a local agent. You can add more agents to your installation using the cloud profile:

In the TeamCity Web UI, go to the Project Settings | Cloud Profiles and select Azure to create a cloud profile to start TeamCity agents:teamcity-profile

Configure a VM image:

Select teamcity-demo resource group, set container (preview) as the image type, and specify the jetbrains/teamcity-agent docker image. Configure the remaining settings and save them.

Note that specifying the storage account will persist container volumes in Azure, preventing the agent upgrade on each start.

teamcity-profile-image

After you finish the setup, it’ll take the agent about 10 min to connect to the TeamCity server: this time is required to start a VM from the created image, then the machine needs to download all the required plugins, etc.

The connected agent will be visible on the agent page:

teamcity_agents2

Configuring artifact storage

By default, TeamCity uses built-in storage for artifacts. To switch to Azure cloud storage, perform the following:

  1. In the TeamCity Web UI, go to the Project Settings | Artifacts Storage tab. The built-in TeamCity artifacts storage is displayed by default and marked as active.
  2. Click Add new storage. Select Azure as the storage type. Optionally, provide a name for your storage.
  3. Supply your storage credentials:
    1. in the Azure portal, go to Storage accounts -> Access keys and copy the storage account name
    2. paste it to the account name in the TeamCity.
    3. Perform the same for the key – any of the two keys available on the portal will work.
  4. Save your settings.
  5. The configured Azure storage will appear on the Artifacts storage page. Make it active using the corresponding link.
    teamcity-artifact-storage-active

Now TeamCity will store build artifacts externally.

Happy building!

image description