Creating a Team City 9 server on a Windows Azure VM

As part of the crane open source project that I talked about in this post, I am setting up a Team City Server in Azure.

I ran into a few problems so I wanted to document the process from start to finish here:


  1. Create a new VM on azure using the Azure management portal selecting a Windows Server 2012 R2 machine
  2. Click on “all items” on the left, select the new virtual machine then click ‘connect’ in the bar at the bottom.  This will download an rdp file configured to remote in to the desktop.
  3. Log in to the new vm using the username and password you setup in step 1
  4. At this point I wanted to download and install Team City but I had real trouble getting Team City to download in IE.  I then tried to download Chrome and I could not get Chrome to download either.  So I ended up installing chocolately and then installing Chrome through chocolatey.  If anyone reading this knows a better way please let me know.
  5. Open powershell as admin
  6. Run the command “Set-ExecutionPolicy Unrestricted”
  7. Run the command “iex ((new-object net.webclient).DownloadString(‘‘))”
  8. Chocolately should now be installed.  Next we need to install Chrome using chocolatey.  Run the command “choco install GoogleChrome”
  9. Open up google chrome and download the Team City 9 EAP (or whichever version of Team City you want to run)
  10. Run the Team City installer, for ease I would use port 80 for the port.  Select the local system account both for the team city server and agent service
  11. Team City should now be up and running, feel free to configure your builds using crane 🙂
  12. Now at this point I thought (naively) that it would all just work but that’s not the case.  You need to setup some firewall rules to allow traffic through
  13. Open server manager (by default its the first item in the task bar with the picture of the suitcase)
  14. Click “Tools > Windows firewall with advanced security” to open up the firewall rules window
  15. Select “inbound rules” then “add new rule”, this will open up the new rule wizard.
  16. Select “port” as the rule type, click next.
  17. Type 80 in the port box (or whichever port you used for Team City), click next
  18. Click “allow the connection”, click next
  19. Leave the profile as is, click next
  20. Then click next on the last screen
  21. Now we have configured Windows Server to allow the connection, now we just have to open up the load balancer in azure…
  22. Go back to the azure management portal
  23. Click on all items on the left and select your virtual machine
  24. Select endpoints at the top
  25. Click add at the bottom
  26. Select add a “stand alone endpoint” click next
  27. If you have used port 80 then you can simply select “http” from the drop down list and click next.  If you have used a custom Team City port then you will need to set up the private port to the port you put Team City on and the public port to the port you want to use on the internet.  For example if you put Team City on port 8000 but you want to access it on port 80 you would select port 8000 for the private port and 80 for the public port.  Click next.
  28. Once Azure finishes updating you should now be able to access your Team City server on the internet by going to <vmname>

I hope you found this helpful and it has saved you some time.  I don’t think a lot of that is obvious out of the box.