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.

Crane – Building you into the pit of success

I have recently started an open source project with a colleague (Ed Wilde). The project is called crane check it out on github. The idea behind the project is to write a tool that creates .Net builds for you automatically. For those of you who have spent time on a build server like Team City (not to pick on Team City as all build servers suffer from this) it takes quite a bit of time just to set up a boiler plate build.

A lot of that time is spent configuring the steps of the build normally something along the lines of the following:

  1. Get latest source
  2. Updated assembly build versions
  3. Build software
  4. Run tests
  5. Pack into nuget
  6. Publish into nuget

It can be confusing even for a developer with experience to set the build up in the right way and not only that but in a way that scales well as more applications are built.

This is where crane comes in.  The idea is you can point crane at your solution and it will generate you a build automatically with all of the steps in place.  By convention.  We believe we can use our experience of configuring builds to give you a great starting place either for a brand new project or to create a build for an existing project.

We are also planning to give crane the ability to create build chains by analysing your solutions.  This will give you the ability to split up your code base and work on smaller projects without the headache of trying to build it.

We would love to hear your initial thoughts on crane and whether it would be a useful tool for you.


Exception Caught TV – Introduction to Git

At work I was asked to give a presentation on git, an intro presentation aimed at someone who has never used git before.  Whilst preparing for the presentation I was doing a lot of practicing.  Whilst practicing I had the idea of recording the practice sessions and turning them into a video series and sharing them online.

The benefits of this are two fold as firstly it gives me a great way to practice my presentation material and secondly it leaves a permanent record that will hopefully help people out who want to learn git.  If there is good feedback from this series I may well make more videos so please give me any feedback you have, good and bad.

You can access all of the videos on the new exception caught TV page.  For connivence here are the links:

Accessing localhost from the internet

On the latest edition of the excellent Javascript Jabber podcast one of their guests has suggested an excellent tool in their picks section. The tool is called ngrok. Ngrok makes your localhost available on the internet! Very handy if you want to test you local site on a mobile, tablet or share with someone outside of your network.

If you are interested you can download the tool from:

There is a version available for Mac, Windows, Linux and ARM. The program is really simple to use. On the Mac you simply unzip and run by running ./ngrok from the terminal. This then gives the following output:

ngrok                                                                          (Ctrl+C to quit)

Tunnel Status                 online
Version                       1.7/1.6
Forwarding                    http://<address> ->
Forwarding                    https://<address> ->
Web Interface       
# Conn                        0
Avg Conn Time                 0.00ms

Then you simply go to the address listed and you will be forwarded on to your machine on port 80. Note I have removed the address above.

From reading the documentation ngrok gets much cooler. It will give you a full detailed log of everything it’s captured on http://localhost:4040, allow you to replay requests, capture requests, forward requests on to another machine on the network and much more.

You can check out the source on github. Looks like the main contributer was Alan Shreve, great work Alan. Check out his website. I love the fact the community produce cool tools like this!