Wednesday, August 24, 2011

Azure Fast-Deploy

We have been building a web system on Windows Azure for quite a while now in my company, and are very familiar with the 20 minute development cycle of redeploying an Azure Role. Recently, the Windows Azure team released a streamlining process for doing web deployments to Azure (for development purposes only, not production deployments). Andy Cross talks about it here: http://blog.bareweb.eu/2011/04/using-web-deploy-in-azure-sdk-1-4-1/

The azure team blog talks about it here.

We tried to use Web Deploy, but we don't do things from Visual Studio. We instead do everything from the command line for our automation (since we do a TON of automation). As such, we tried for a while (to no avail) to get Web Deploy to work from the command line (tried for a while for us is measured in minutes not days, we don't have much patience for crappy tooling on our team).

So... we built our own.

It works like this - we have a very simple console app that we built in C# that looks at a particular blob storage account and tries to download a new blob from there if a new blob exists. In our case, we've named the container "w-deploy-newbits" and the blob name is "WebRole.zip". This zip file is built on our build machine by doing a msbuild /t:Publish on our ccproj in order to build a deployable version of our website (_PublishedWebsites\WebRole in our build folder). We zip this file and upload it to the appropriate cloud location from the desktop as part of our build script (powershell with psake), and when the "NewBits" console app sees that new zip, it redeploys.

We have been using this technique for our profiling of our app (for performance) so that we can quickly make changes, redeploy, reprofile, and repeat the process. It has worked VERY well for this. We have no intention of using this for production releases or anything of that matter and would never recommend such a thing.

I'm going to try to make the code available in github, but it will probably take me some time to do so, as I need to remove anything sensitive to our own application setup and I'm really busy right now. However, if you want more details about how we did this, please feel free to contact me via comments or my email address.