Part I: Initial provisioning of your Paas environment

Sitecore 9 in Azure Paas for Dummies

When I tried setting up my first Sitecore 9 PAAS project, the world of PAAS was pretty new to me. I knew what PAAS was, but did not have any experience with it. Also Sitecore 9 had just shipped with a new set of tools for installing your environments. The official sitecore documentation on this is pretty good. I also found a lot of information regarding this on the blog site of Rob Habraken regarding blue-green deployments.

In his blog-post Rob tells us how to have:

  • A clean install per deployment, based on vanilla Sitecore install (no history or previous / old file build-up)
  • Keep our database content and only deploy new or changed items
  • Don’t disturb visitors of the live site with the deployment process
  • An option to rollback the deployment upon failure
  • A repeatable process, which is of course fully automated

Rob’s post was based on the tools available with Sitecore 8. Now most of what he is talking about is still valid. With Sitecore 9 however, Sitecore has done some the customizations out of the box where Rob needed to do manualy with Sitecore 8.

Next to that, I also stumbled a bit on the technical level of the posts I could find online regarding Sitecore on Azure Paas. Since I was completely new to Azure Paas, I was missing some basic information. It was like the information immediatly jumped to Chapter 2.

In this post I series I will try to provide a guide for absolute newbies to Sitecore 9 on Azure PAAS.

Setup a storage account

Let’s login to https://portal.azure.com and make sure you are in the correct directory.

Then, let’s add a new resource group in your subscription. A resource group will bundle all the resources you create in your azure subscription. Basicly everything you create in Azure is a resource. This can be a web application, a web server, a database, a search engine, etc…

I like to keep my storage account into a seperate resource group. The scripts we will later on use, will create a bunch of other resources bundled in a second resource group. By keeping the storage account seperate you can easily delete the generated resources with one click and keep your storage account. This can become handy when experimenting and trying out stuff.

To create a new resource group, go to resource groups and click create.

Finally, we need to create our storage account.

Go to storage accounts and click create. Make sure to add it into you resource group.

Next add a public container into your storage account.

Set the public access level to container since we will also use the storage account to store the ARM templates instead of using a public git.

You are now ready to use Microsoft Azure Storage Explorer to log into your storage account.

Our first setup

Our initial deployments will consist of 3 types of assets:

  • A set of ARM templates containing information about the server architecture and assets to install on it
  • A set of Sitecore Packages containing the vanilla sitecore and dacpac’s to intitialize the database
  • Some scripts to execute the ARM templates

In our first attempt, we will stick to what is provided by sitecore without making any modifications to packages or templates.

In this effort we will setup a XP1 environment. XP1 is also known as XP Scaled. (XP0 is also known as XP Single)

Sitecore Packages

First, we need to get the sitecore packages from https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Initial_Release.aspx .

Download the packages for XP Scaled under “Download options for Azure AppService”.

Once downloaded, upload them to your storage account in the “packages/xp1” folder. (You will need to create this)

ARM Templates

Next we will need to upload the ARM templates.

These can be downloaded from GitHub.

https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates/tree/master/Sitecore%209.0.0/XPSingle

Store them in you storage account under “Templates/xp1”

Scripts

Please download this zip file

It contains some scripts and parameter files in this filestructure:

  • <<PROJECT_ROOT>>
    • Source
      • deployment
        • Environments
          • Development
        • Scripts
          • Functions
          • Provision-Deploy

Create a certificate

Before starting a Sitecore 9.0 deployment, you must obtain or generate an authentication certificate and store it in PKCS #12 format (.pfx).

Create this certificate and add it into <<project_root>>/Source/deployment/Environments/Development

Sitecore License

Add your sitecore license into <<project_root>>/Source/deployment/Environments/Development

Parameter file

First we need to adapt the azuredeploy.parameters.json file in the Environments/Development folder.

Pay attention to these fields, the other ones can be left blank.

  • sitecoreAdminPassword: choose a password for the admin user (preferable not “b” :-))
  • repAuthenticationApiKey: fill in a random guid
  • sqlServerLogin: The name of the administrator account to be created for Azure SQL server. (You have free choice here, as nothing is setup yet)
  • sqlServerPassword: The password for the created Azure SQL server. (You have free choice here, as nothing is setup yet)
  • a bunch of packageUrl: get the url’s of the corresponding packages uploaded in your storage account
  • authCertificatePassword: the password of the certificate you created

Set your Tenant Id

Log into azure portal.

Go to Azure Active Directory > Properties.

Copy the Directory ID.

Next open the login-azure-subscription.psm1 script located under Functions.

Paste the Directory ID into the TenantId parameter.

Install Azure Toolkit 2.0

Download Sitecore Azure Toolkit 2.0 from dev.sitecore.net and follow the instructions at https://doc.sitecore.net/cloud/82/working_with_sitecore_azure/configuring_and_deploying_sitecore_azure/getting_started_with_sitecore_azure_toolkit

Next open up provision.psm1 file in the Scripts/Functions folder and adapt the AzureToolkit location.

Final Step

Finally open up the provision-xp1-bundled-dev.ps1 file.

Point the ARMTemplateFile to the location of your Azure Storage Account, the azuredeploy.json file.

Set the DeploymentId to any given name. This will be the name of the resource group that will bundle all the resources that will be created.

Set the subscriptionId. (The subscriptionID can be found in Azure Portal on any created resource like the storage account)

 

Run the script!

 

When finished you should have a running Sitecore 9 in Azure Paas.

Next Steps

Now that we have created our first Sitecore 9 in Azure Paas we can take things one step further.

Over the next blogposts in this series we will discuss these subject:

2 Responses to “Part I: Initial provisioning of your Paas environment”

Author's gravatar

Hey,

great article. I did want to point out that you do not want to make the storage account public, at least not the portion that houses Sitecore web deploy packages (Sitecore prohibits them being accessible). Instead for templates, I use templateLinkAccessToken ARM supported property to push Shared Signature to access templates assets, and where applicable manually set package URLs with the value from templateLinkAccessToken. What are your thoughts around that?

    Author's gravatar

    Hi Roman, you are correct. It is better to secure them by access token.

Leave a Reply