Running Umbraco on Azure – Part 2

For the other posts in the series go to Part 0

In this post we are going to setup the Azure infrastructure and publish the initial databases.

Setting up Azure

Open the Azure Portal


First we will create a Resource Group, you can allow this to be automatically created later but it will get its location set to West US which is usually not what you want (unless you’re American) and cannot be changed.  So.

Click Create Resource and search for ‘resource group’


Click Create


Give it a name, select a subscription and location (choose the one nearest you expected customer base)

Click Create

Click App Services


Click Add


Select ‘Web App’ and click Create


Enter a name

Select the subscription

Under Resource Groups, select Use existing and select the one you just created

Select Windows for the OS

Click ‘App Service plan/Location’ then Create New


Give it a name

Set the location (use the same one you chose for the Resource Group)

Select a Pricing Tier – you will need a minimum of S1.  D1 can work but you won’t get Deployment Slots so no Test/Dev environment

Click Ok

Set Application Insights to on

Click Create

Setting up the Databases

Click Create Resource and search for SQL Server (logical Server)’


Click Create


Fill in all the bits

Set Resource Group to the one you created earlier

Click Create

Open the server when it is created


Click Show Firewall Rules


Click Add Client IP

this will create a rule to add you current IP address to the list 
of allowed connections


Click Save

Click Properties and make a note of the Server Name

Open SQL Server Management Studio (SSMS)


Connect to the database you created for Umbraco

Right click on it, select Tasks


Select ‘Deploy Database to Microsoft Azure SQL Database…’

NOTE: if you don't have this option you need a newer version of SSMS


Click connect and connect to the server you created in Azure

Name the database umbraco_db_one

Edition – standard

Size 1gb (you can adjust this later if you need more)

Service objective – s0 (you can adjust this later if you need more)

Click Next

Click Finish

Repeat these steps to create a second database called umbraco_db_two

Go back in to Azure and open the SQL Server

Copy down the connection strings for the two databases.

Go to the App Service you created in part one


Go to Application Settings and add a connection string called ‘umbracoDbDSN’ with the connection string you copied from umbraco_db_one

Click Save

Go to Deployment Slots

Create a slot called ‘Test’ and copy its configuration Source from the existing App Service

Open the Slot and change the values of the ‘umbracoDbDSN’ connection string to the value you copied from umbraco_db_two

Save everything.

Go to Part 3 to setup the Continuous Integration and Continuous Deployment


Running Umbraco on Azure – Part 3

For the other posts in the series go to Part 0

In this part we will set up Continuous Integration and Continuous Delivery so we can actually publish the Umbraco site

Set up Continuous Integration



Click Build and Release

Select Builds


Click New Definition


Select your source

Click Continue

Choose the ASP.NET Template


Select the Build Solution Step

change MSBuild Arguments to

/p:OutDir=$(Build.SourcesDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true

Add a Copy Files step before the Publish artifact step

Set source folder to $(Build.SourcesDirectory)

Contents to **\*.zip

Target folder to $(Build.ArtifactStagingDirectory)

Edit the Test Assemblies step

change Test Assemblies to

**test*.dll !**\obj\**

Go To Triggers

Set Enable continuous integration to yes

Click ‘Save and Queue’

Wait for the build to finish

Set up Continuous Delivery

Click Build and Release

Select Releases

Click New Definition

Choose the ‘Azure App Service Deployment’ template

Set the Environment Name to ‘Test Environment’


Click Add Artifact

Under Source select the build definition created earlier

Click Tasks

Set the subscription

Set the App Service Name to the one created in step 1

Select the ‘Deploy Azure App Service’ step

Select ‘Deploy to Slot’

Select the Resource Group

Select the Slot ‘Test’ that you created earlier

Click Save