Folks, we are all aware of Team City which is one of the powerful CI/CD tool by Jenkins. Most of you have already used or have been using Team City in your current CI/CD processes. We have installed Team City on premise as well as in cloud VM. However CoreOs came up with a readily available Azure template for Team City versioned under Ubuntu but following large scale containerized deployments. Hence, once you deploy the template which will provision a CoreOS Virtual Machine, you cannot RDP to the machine because CoreOS is designed with minimum functionality just to provide clustering infrastructure.

I did faced typical situation where I have installed Azure TeamCity but unable to log into the server or RDP the machine due to its limitation. Hence, I thought to share the proper installation procedure if you are opting for Azure TeamCity template.

image

 

Create a public SSH key

If you have never used Cloud Shell, let me tell you that it provides a command line access to all resources directly from the browser. Even if you have not installed PowerShell or Azure CLI, you can use  Cloud Shell to perform all Shell and Bash operation.

Open Cloud Shell by clicking the icon as shown here.

image

If you are opening Cloud Shell for the first time, you will be asked to select the environment which can be either Bash (Linux) or PowerShell (Windows). Select bash if you want to go for it.

image

Then you need to mount a storage for Cloud Shell as it requires Azure file share to persist files. So go ahead and create a storage for cloud Shell. You can even select existing storage if you have any under which you want to create the File Share by clicking on Show Advanced Settings in the Create storage window.

Once the Cloud Shell is configured, type the command ssh-keygen to generate a public rsa key pair. This key would be used to authenticate user in order to log into the VM for the first time. You will be prompted to give a name to the file where the key will be saved. After the successful generation of the key pair, it will be saved in the specified file with .pub extension.

image

Once the key has been generated and saved, you can get the content of the ssh-rsa key pair by using the command cat {Keyfile} like cat sshkey1.pub.

image

Copy the whole content starting from “ssh……..till the end of the content” to some secured location from where you can refer it in future. In case you have forgot to copy it, just remember the key filename which you can again do “cat” in order to get the content.

 

Provision Team City from Azure marketplace

Our next step is to use the template from Azure marketplace to deploy Team City server. From the template, click Create.

image

Configure the basic information by providing the server name, team city version, resource group name and location.

image

Configure the Virtual Machine Settings having information like VM User Name, VM Size, Domain Name, Subnets and leave rest as it is. In case of VM Authentication Type, do select SSH public key instead of Password. Provide the ssh-rsa key pair content that we have got earlier from the Cloud Shell.

image

Provide the additional settings like Installation size and MySQL password.

image

Complete rest of the installation process after successful validation.

image

 

Login to Team City Server

After successful deployment of the server, browse the DNS which has been created like http://teamcitydemo.southcentralus.cloudapp.azure.com

Don’t worry if you get DNS error first time. Wait for a minute and then refresh the page few times. Finally you will be able to view the Maintenance page where database creation, server component initialization, etc., will happen.

image

After the maintenance is complete, you will be redirected to License agreement screen which you need to accept.

image

In next screen you need to setup the Administrator account.

image

After the completion of the Admin account creation, you will be successfully logged into Team City account.

image

That’s it. Hope this help.

2 thoughts on “Provisioning of Azure Team City to build CI processes

Leave a Reply