TeamCity Azure cloud integrations allows TeamCity to use your Azure account to automatically manage virtual machines with TeamCity agents on-demand, based on the queued builds.
An Azure virtual machine/image with an installed TeamCity agent pre-configured to start the TeamCity agent on boot is required.
Currently two plugins are supported: Resource Manager and Classic. Select an appropriate plugin according to the Microsoft deployment guidelines.
You can download the last successful plugin build and install it as an additional TeamCity plugin.
|Resource Manager||Download||9.1.2+||blog post|
Resource Manager Plugin
The plugin supports generalized virtual machine images to start TeamCity build agents. You must use the Azure AD application and the authentication key to enable cloud integration and assign the Contributor role for it in your subscription on the new portal.
You need to prepare virtual machine with TeamCity build agent and capture it as VHD image to use it as a source for cloud build agents.
Depending on the type of the virtual machine, the plugin behavior is different:
If you use an existing virtual machine instance, TeamCity will start and stop it on demand. The instance is started before a build and is stopped after the build is finished or an idle timeout elapses (depending on the profile settings). The instance state is saved. When the TeamCity server URL changes, you need to change the
serverUrl parameter in buildAgent.properties to point to the new server.
If you use a virtual machine image, TeamCity will create and start a new instance from the image and stop and delete it after it becomes unnecessary - the build is finished or an idle timeout elapses, depending on the profile settings. To use this behavior, you need to create an Azure virtual machine image from an existing instance. Refer to the Microsoft Azure web site for details on creating Windows and Linux virtual machine images.
Virtual Machine Preparation
- Create a new virtual machine in the Microsoft Azure.
Perform virtual machine cleanup.
Then execute VHD capturing process according to the Microsoft Azure documentation:
- Resource Manager: Linux and Windows machines, supports only generalized images.
- Classic: Linux and Windows machines, supports generalized and specialized images.
Configure and save the Azure cloud profile on the TeamCity server.