Keep track of all the latest news and events on developer tools and technologies you care about
It’s been over 6 months since we decided that we would build the Tech.Days website using Umbraco and host it in Azure and in that time there have been a number of solutions created to get Umbraco working with Azure. Today I’m going to show you how you can the new Accelerator launched in April to get an Umbraco 4.7 site on to Azure with multiple instances.
When we first put the Umbraco site live on Azure, late last year we had a problem: The first version of the Accelerator would only allow us to add one node. The accelerator enabled us to get things on Azure, but critically didn’t allow us to scale. If we did, the whole site would enter a painful “waiting for node to start” loop. Having a cloud solution that is only capable of having one node is about as useful a chocolate fire guard… and so we searched for a solution.
As a temporary measure we managed to solve the issue by writing our own code based on the Accelerator. This enabled us to initialise a handful of nodes to cope with potential traffic spikes, however, getting it working was quite labour intensive and it required me to learn a lot about the Azure SDK and Umbraco. The result was a rather messy solution that worked but wasn’t particularly reusable, I talked about this solution at Tech.Days.
Surely there was a better way.
Luckily there was. Two better ways in fact.
The New Umbraco Azure Accelerator is what we used for our 2nd Version of the Tech.Day website, this site went live today. This new Accelerator enabled two critical features:
The architecture of a site using the new accelerator looks like this:
Basically the Umbraco website is stored in blob storage and when a web role instance starts up it loads the site from blob storage and attaches it to IIS. If you edit a file inside of blob storage the file change gets replicated across the instances and if you make a change to the instance file system it gets replicated back to blob storage and then in turn it is sent out to the other instances.
All of the data is stored in SQL Azure. You can either let the Accelerator create you a fresh database for you or you can use this tool to migrate an existing SQL database into SQL Azure (This was the tool I used to get the TechDays database from our staging SQL server onto SqlAzure).
All of the session data is stored in either a SQL Azure database or if you are feeling particularly fancy you can use the Windows Azure AppFabric Caching service (there are instruction on how you can do this in the documentation that ships with the Accelerator)
Complete Instructions on how to create and deploy the application are contained as part of the download but general steps are as follows:
Once your site is live it’s pretty easy to adjust the number of instances through the Azure Management portal. All you need to do is:
Figure 1 - Configure Deployment Dialog
The Windows Azure Accelerator for Umbraco will automatically replicate the Umbraco sites on each new instance, allowing your Umbraco instance to scale out.
Alternatively you can change the number of instances programmatically using the service management API . You could for example write a service that scales the application out or reduces capacity based upon traffic spikes.
To use the new accelerator there are a number of prerequisites:
The new version of Umbraco (Umbraco 5)was only released today as a CTP. As yet I haven’t had a chance to test it but I am assured that Azure support will be built into the application architecture. I’m heading off to Denmark today for the CodeGarden event and will be sure to update you afterwards once I know more. Incidentally they are using Azure to host the CodeGarden event site too.