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:
- Create a new VM on azure using the Azure management portal selecting a Windows Server 2012 R2 machine
- 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.
- Log in to the new vm using the username and password you setup in step 1
- 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.
- Open powershell as admin
- Run the command “Set-ExecutionPolicy Unrestricted”
- Run the command “iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1‘))”
- Chocolately should now be installed. Next we need to install Chrome using chocolatey. Run the command “choco install GoogleChrome”
- Open up google chrome and download the Team City 9 EAP (or whichever version of Team City you want to run)
- 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
- Team City should now be up and running, feel free to configure your builds using crane 🙂
- 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
- Open server manager (by default its the first item in the task bar with the picture of the suitcase)
- Click “Tools > Windows firewall with advanced security” to open up the firewall rules window
- Select “inbound rules” then “add new rule”, this will open up the new rule wizard.
- Select “port” as the rule type, click next.
- Type 80 in the port box (or whichever port you used for Team City), click next
- Click “allow the connection”, click next
- Leave the profile as is, click next
- Then click next on the last screen
- Now we have configured Windows Server to allow the connection, now we just have to open up the load balancer in azure…
- Go back to the azure management portal
- Click on all items on the left and select your virtual machine
- Select endpoints at the top
- Click add at the bottom
- Select add a “stand alone endpoint” click next
- 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.
- Once Azure finishes updating you should now be able to access your Team City server on the internet by going to <vmname>.cloudapp.net
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.
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:
- Get latest source
- Updated assembly build versions
- Build software
- Run tests
- Pack into nuget
- 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.
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:
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
Forwarding http://<address>.ngrok.com -> 127.0.0.1:80
Forwarding https://<address>.ngrok.com -> 127.0.0.1:80
Web Interface 127.0.0.1:4040
# 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!