We're on Windows Azure Websites!

I have wanted to officially move all my stuff to the new Windows Azure Websites system for the better part of this year. Until recently there was a big problem with Microsoft's model for Azure Websites. They generously offered you up to 10 websites for free which was great, but you could not use custom host names. Basically what that meant is that I could not tie CodeTunnel.com to my Azure Website. I could do some silly redirects with CNAME records but I couldn't just point an A record at my website like you can pretty much anywhere else you host a web application. The only option you had was to switch your website into "Reserved Mode".

Reserved mode was no small upgrade. Reserved mode was going to cost me somewhere around $50 to $60 a month! I didn't need all the other upgrades that came with reserved mode so that's a huge price jump just to have an actual domain name for my website. So I scrapped it; I reluctantly went to Amazon Web Services hoping to find something better. Amazon's services are really quite impressive but there wasn't any cheap simple options like there were with Azure. Amazon's Elastic Beanstalk service was as close as I could get to automated deployment out of the box and that ended up being extremely expensive if I did more than one website with it.

Since then I've kept checking on Azure hoping they had changed something. It wasn't until earlier this week that Scott Guthrie posted about a bunch of improvements on Azure. One of those improvements was the addition of host names to shared mode websites. I was finally able to get rid of Amazon and go with the simple and almost completely automated solution that I had originally wanted to use. It took a bit to move every website I maintain over to Azure but it was completely worth it.

Here is the two step process for me to make changes to my application and publish them to Azure:

  1. Make changes to application.
  2. Check those changes into source control.

That's it! Don't believe me? Check this out:

What happened here? Azure allows you to setup Git publishing. I discovered just before writing this blog post that Scott Hanselman put together a [blog post][Azure Git] on this very subject just yesterday. Azure sets up a Git repository on the Azure server for you. You can either add that repository as a remote and push directly to it, or you can do what I did and setup a Github hook. With the Github service hook Github will actually go out and tell Azure to update itself and do a deploy from my Github repository every time I push to it. In two steps I was able to commit my changes up to Github and update the live website on Azure.

Because my projects are small I have most of them setup to trigger deployments from the master branch, but you can congiure it to use any branch you want. At work we have a development environment for continuous testing and integration, a staging environment for testing, and a live environment for the live application. If we were to setup something like this here we would simply add a "staging" and "live" branch to our repository. We would then push to the relevant branch to trigger a deployment to that environment. I don't think it can get too much easier or more awesome than that!

Now that Microsoft has ironed out a bunch of the kinks in their new Websites feature I am happy to give them my full support and will definitely recommend the service to everyone!