Putting Umbraco On Azure

What do the bands Take That and Abba have in common? No it’s not that they both have lead singers that like one too many cream cakes (I’m not mentioning names), they both run their websites using Umbraco. Umbraco is a .net open source content management system that powers over 85,000 websites and has one of the most friendly developer communities in the world.

In this post I’m going to show you in how to put Umbraco on Azure. Putting existing applications on Azure that have not been developed with Azure in mind can be tricky, but it is possible.

First you will need a copy of Umbraco, it’s best to configure this locally and then send the finished version up to Azure. The easiest way to get a copy of Umbraco is use WebMatrix. To get this go to https://www.microsoft.com/web/umbracoand hit the Install Umbraco button and follow the installation instructions.

When WebMatrix is installed you should be able to select “Build site from web Gallery”. Select “Umbraco CMS” and give you site name, I called mine UmbracoToAzure then I pressed the next button.

It will ask you to accept the licence and then download all of the required files to run Umbraco Locally. Once you have followed all of the the instructions you will be at the main Umbraco screen. Just press run and you can then go through the site set up. You should note down the application Path which is shown on this screen as you will need it later to configure the Azure application.

Click “Lets Get started” on the welcome screen and on the licence screen click accept. On the database screen enter the details of your SQL database. You can use SQL azure if you like, but this tutorial won’t cover that, details on how you can do it can be found here.

You will need to set up a user to access the site, then choose the type of site you want and the skin for the site. In this tutorial I have chosen, Business with a Umedia skin. Next we can start to configure Azure so that it is ready to host our site.

You should go to https://windows.azure.com login and then set up a new Storage Account. To configure a storage account you will need to enter a name and a location. I choose uktechdays and set the location as Western Europe. Once this has been set up, click on the storage account and view the storage access key. Copy this and paste it somewhere for safe keeping as you will need this later on.

Head over to https://azureaccelerators.codeplex.com/releasesand download the Umbraco Azure Solution Accelerator and open it up in Visual Studio. For future reference you should also download the documentation which can be found at https://azureaccelerators.codeplex.com/documentation.

When you open up the accelerator solution scroll down to the AcceleratorService, right click AcceleratorWorkerRole and Select Properties. Edit the Application Connection String and enter the Azure storage Name and Account Key that you noted down earlier. You should also fill out the other properties like the file path of the Umbraco installation, this is something else you should have noted down earlier. Change the AcceleratorApplicationproperty to Umbraco,4.x

Build the application then open up the Windows Azure SDK command Prompt an navigate to the publish folder and run the command AccelCon /u /w /q

For me the commands were:

cd C:\Users\mabeeby\Documents\Visual Studio 2010\Projects\umbraco\publish

AccelCon /u /w /q

This will place the project files in the cloud storage. We will then publish the application and select Create Service Package Only. It will output two files: AcceleratorService.cspkg and a ServiceConfiguration.cscfg. Take note of the folder that these are published too as you will need it in the next step.

Go to https://windows.azure.com and create a hosted service. Upload the two files created in the last step as the package location and the Configuration file. Make sure you give your application a unique name and URL and then choose the same region as you selected for your storage account, also choose to deploy straight to production.

After about 10 minutes you should then be able to navigate to your Azure URL and Umbraco should be installed.