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:
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.
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.
Most of the TeamCity installation is automated, all you need to do is perform a few steps:
- Log in to the Azure portal.
- In your browser, open the TeamCity offer in the Azure Marketplace.
- Select GET IT NOW
- Review the pricing and terms information, select Continue.
- Select Create at the bottom of the page to configure a TeamCity installation.
- Configure settings:
- In the Basics tab, create a new resource group, in our case teamcity_demo:
- 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.
- On the Additional Settings tab, select the TeamCity installation size and provide a password for the MySQL database of your TeamCity instance.
- 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.
- Click Refresh. Upon a successful installation you’ll see the TeamCity URL name in the deployment Outputs tab:
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:
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.
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:
Configuring artifact storage
By default, TeamCity uses built-in storage for artifacts. To switch to Azure cloud storage, perform the following:
- 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.
- Click Add new storage. Select Azure as the storage type. Optionally, provide a name for your storage.
- Supply your storage credentials:
- in the Azure portal, go to Storage accounts -> Access keys and copy the storage account name
- paste it to the account name in the TeamCity.
- Perform the same for the key – any of the two keys available on the portal will work.
- Save your settings.
- The configured Azure storage will appear on the Artifacts storage page. Make it active using the corresponding link.
Now TeamCity will store build artifacts externally.