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

azure1.PNG

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’

azure2.PNG

Click Create

azure3

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

Click Create

Click App Services

azure4

Click Add

azure5

Select ‘Web App’ and click Create

azure6

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

azure7

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)’

azure8

Click Create

db1

Fill in all the bits

Set Resource Group to the one you created earlier

Click Create

Open the server when it is created

db5.PNG

Click Show Firewall Rules

db6.PNG

Click Add Client IP

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

db7.PNG

Click Save

Click Properties and make a note of the Server Name

Open SQL Server Management Studio (SSMS)

ssms1

Connect to the database you created for Umbraco

Right click on it, select Tasks

db3.PNG

Select ‘Deploy Database to Microsoft Azure SQL Database…’

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

db4

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

as1.PNG

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

Advertisements

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

Open VSTS

vsts1.PNG

Click Build and Release

Select Builds

vsts2.PNG

Click New Definition

vsts3

Select your source

Click Continue

Choose the ASP.NET Template

vsts4.PNG

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’

vsts5

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