Installing Sitecore 9 on Mircosoft Azure Cloud as PaaS : Know your options

Installing Sitecore 9 on Microsoft Azure Cloud as PaaS has never been easier than before. There are 2 main routes that you can take:

  1. Install via Azure Market Place
  2. Install via Sitecore Azure ARM Templates

I have blogged about both options 1 and option 2 previously, but with Sitecore 9 release there are some updates. This blog is just a follow up about the changes since last release and it is based upon Sitecore 9.0 and Sitecore Azure Toolkit 2.0.

Option 1 : Install via Azure Market Place

The Azure Market Place module for Sitecore has been updated with a nice 4 step wizard. The configuration wizard will ask you to choose your Sitecore version, choose your region, add your own credentials, review legal terms and conditions, click the magic button and let Azure do its business.

I believe any non-technical person with an Azure account can do this installation without any help or bugging IT to setup servers for Sitecore 9. Bonus information, you can tick the box for Sitecore Experience Accelerator 1.5 during the installation wizard and SXA will be installed as well for you to play around with 80+ pre-built components like Carousel, Gallery and so on. The following screen shot from the Azure portal is showing different resources that were deployed successfully after I ran the Sitecore installation wizard for Single  (CM & CD combined) size.

Option 2 : Install via Azure ARM Templates

This is slightly more technical option as you will need to manually configure ARM templates (read JSON files) and use Windows Powershell. I have blogged in detail about this earlier so I will not go in details this time. I will only mention what I found was different for Sitecore 9 installation and the issues I ran into during the installation process.

There were 2 changes:

  1. You have to supply a secure certificate’s blob and it’s password within the parameters file.
  2. You have to use ArmTemplateUrl parameter instead of ArmTemplatePath  for the Start-SitecoreAzureDeployment command.

As given on the Sitecore documentation site, you need to generate the self-assigned certificate, export it and get its blob. I have combined the scripts into a single script and added additional code to get the blob so you can easily get the required secure certificate blob by running the following script:

PS C:\azure\sitecore-azure-2.0> .\self-assigned-ssl.ps1

I wanted to deploy the XP topology so I updated the azuredeploy.parameters.json file on my local machine with information as below:

Then I created a xp1install.ps1 file with parameters and raw link to the ArmTemplateUrl from the quick start templates section: (this is optional step, you can enter these values directly in PowerShell too)

From the Windows Powershell command line, navigated to the Sitecore Azure Toolkit 2.0 folder and ran this command

PS C:\azure\sitecore-azure-2.0> .\xp1install.ps1

Waited about an hour or so and the XP installation was up and running on Microsoft Azure Platform.

 

If you look closely in the screen grabs above, 19 resources were deployed during the single type of installation and 31 resources were deployed during the XP installation.

Errors during Azure ARM

I ran into 2 errors during the Azure ARM deployment:

Error 1 – InvalidTemplate Error

Initially, I was using ArmTemplatePath and was providing the full path to the template on my local machine, but it turns out, that I needed to provide ArmTemplateUrl as mentioned in this blog. Supplying the correct parameter with Github’s path resolved this error.

Error 2 – Cannot find certificate

I was supplying the path to the certificate instead of the base64 encoded string. Thanks to the Sitecore Slack community that came to the rescue and I was able to resolve this by generating the secure certificate correctly and supplying it’s blob value.

I hope it is going to help if you are doing Azure ARM deployments with Sitecore 9 in coming days!

Thanks.

Advertisements

Getting Started with Sitecore and Microsoft Azure Apps – Part 2 – Deploying through ARM templates

In previous blog, I have shown one-click deployment of Sitecore on Microsoft Azure. In this blog, we will explore the topics of Azure Resource Management (ARM) templates and Sitecore Azure Toolkit to do our Microsoft Azure deployments.

Before we begin!

What are ARM templates anyway ?

If you have not heard about them before, you are not the only one.

Simply put, they are JSON files where you can define the structure and configuration values (just like web.config file but in json format) of what you want to deploy. For more information about ARM templates, please visit Microsoft documentation.

Sitecore Azure Toolkit streamlines your Microsoft Azure deployments using ARM templates and gives you out of the box integrations for Microsoft Application Insights, Microsoft Azure Redis Cache and Microsoft Azure Search. This toolkit is a great starting point if you are at beginner level.

Pre-requisites

In order to do Sitecore deployments, there are some prerequisites that you will need to install on your machine as mentioned in the documentation.

As of today, you will need the following tools and packages:

Once you have installed the tools and downloaded pre-built Web Deploy packages, you can follow the step by step guide below and do a Sitecore Azure PaaS deployment for XP1 configuration:

Step 1: Upload Web Deploy packages

The first step will be to upload the Web Deploy packages at a location which can be accessed over the internet during our installation process. Microsoft Azure provides storage accounts to store any kind of data that can be accessed over internet. Create a new storage account within the Azure portal using this guide  and then upload the individual server role scwdp.zip packages. I am using Sitecore 8.2 up-3 and for XP1 configurations so I have uploaded the following packages:

  • Sitecore 8.2 rev. 170407_cd.scwdp.zip
  • Sitecore 8.2 rev. 170407_cd.scwdp.zip
  • Sitecore 8.2 rev. 170407_prc.scwdp.zip
  • Sitecore 8.2 rev. 170407_rep.scwdp.zip

Once you have uploaded the packages, open ‘Microsoft Azure Storage Explorer’ and connect to your account. Generate a shared access signature URL for each of the packages and note it down for later use as shown below:

 

For example, one of the shared access URL will look like this

https://sitecorewdp.blob.core.windows.net/sitecorewdp/Sitecore%208.2%20rev.%20170407_prc.scwdp.zip?st=2017-05-04T05%3A28%3A00Z&se=2017-05-05T05%3A28%3A00Z&sp=rl&sv=2016-05-31&sr=b&sig=QWdz%2BAwz%2BAPVuwj7EC0kEZsL4BMl3mkZIOigNjicOAY%3D

At the end, you should have 4 web deploy packages URL.

Step 2: Setup MongoDB collections for analytics

The next step will be to setup MongoDB for the deployment. You can either provision a new VM through Microsoft Azure and install MongoDB and then create your databases or you can use 500 MB of FREE MongoDB storage provided by mlab.com.

If you have never used mlab for Sitecore before, please follow this guide  by Sitecore MVP David Peterson to create 4 individual MongoDB for your site. 

Step 3: Update azure.parameters.json

Once you have noted down shared access URLs for web deploy packages and also got connection strings for MongoDBs, the next task is to update the azure.parameters.json file.

Assuming that you have downloaded the Sitecore Azure Quick Start ARM templates from GitHub , navigate to the ‘xp’ folder and update the azure.parameters.json file with the parameters that you have recorded earlier.

You can leave licenseXml value as blank as it will be passed through the command line.

Step 4: Setup Sitecore Azure Toolkit folder

I downloaded the Sitecore Azure Toolkit zip package and copied to a location C:\azure\sitecore-azure on my local machine. Then I copied the Sitecore license file and the ‘xp‘ folder that I modified in the previous step in the same folder location. This will make sure that I do not make any path related errors while I am running the PowerShell commands

Step 5: Run PowerShell Commands

Okay, the moment of truth has arrived.

Open PowerShell in administrative mode and navigate to the Sitecore Azure Toolkit folder. In my case it will be ‘C:\azure\sitecore-azure‘ and then run the following 2 commands to setup PowerShell:

  • Add-AzureRMAccount – this will show a pop-up to login to your Azure account
  • Import-Module .\tools\Sitecore.Cloud.Cmdlets.psm1 -verbose – this will load the Sitecore specific Azure commands into the session.

 

Now we are ready to provision our environment with just one command. If you have followed the steps as above and have entered values in your parameters.json, just entered the following command:

Start-SitecoreAzureDeployment -location ‘East US’ -Name ‘SitecoreAzureXP1DeploymentMay2017’ -ArmTemplatePath ‘.\xp\azuredeploy.json’ -ArmParametersPath ‘.\xp\azuredeploy.parameters.json’ -LicenseXmlPath ‘.\license.xml’ -SetKeyValue @{}

This will show a message that deployment has started:

Then you can go and make yourself a cup of coffee as you have to wait for another 15-20 minutes before the deployment will be completed and you see a success message.

Navigate to to your dashboard portal and you should see all of your services running for the deployment!

I

Video

I think the topic is complicated enough and a simple video can give a better overview:

 

 

Overview of XP1 Architecture

When you deploy Sitecore with XP1 configuration using quick start templates and Sitecore Azure Toolkit, you get the following services:

  • CM App Service Plan & CM Web App
  • CD App Service Plan & CD Web App
  • Reporting App Service Plan & Reporting Web App
  • Processing App Service Plan & Processing Web App
  • SQL Server with Core, Master and Reporting DB
  • SQL Server with Web DB
  • Application Insights (used for logging exceptions and much more)
  • Azure Search
  • Redis Cache

In order to understand it better, you can see the following topology diagram.

 

That’s it, Sitecore Azure Toolkit really makes it easy to do customized your Microsoft Azure PaaS deployments. It is a great tool and you should really check it out!

Thanks

Naveed.