What is ARM template all about?

ARM template is a way to declare the Azure resources with its name, types & properties. You can directly create and install the defined resources in ARM template using Powershell. So the steps we will use are:
  1. Get the pre-requisite WDPs for the specific Sitecore version
  2. Create and upload WDPs in an Azure Blob storage
  3. Get the ARM template and fill the WDPs in the parameter file
  4. Create a self-signed certificate
  5. Run the Powershell command to execute the ARM template and create the Azure resources

Get the pre-requisite WDPs for the specific Sitecore version

Before starting, choose the Sitecore version you want to proceed with. In our case, we are heading with Sitecore 9.2.0 XP.

Create and upload WDPs in an Azure Blob Storage Account

Log on to your Azure portal to create a storage account. Click on the “Create resource” link and search for “Storage Account”. While creating, choose your subscription and resource group and a unique name for the same. Set account type as “Blob storage” with “Hot” access tier.
After successful creation of the storage account, go to your storage account and select “Blob” under “Blob Service”. The container name we are using is named “mnmsitecoredeployables”.
Install Sitecore 9.2.0 Using ARM Template In Azure PaaS
Create a new container. You can set the access level to public or private. In the case of public you don’t need to generate a SaaS URL to access, it can be accessed directly.
Now unzip the WDP container file and upload all the zip files into this container. Both Sitecore XP 9.0.2 Single & Identity files. You also need to upload your active Sitecore license file.

Get the ARM template and fill the WDPs in a parameter file

Now it’s time to get the ARM templates from GitHub. To get all the ARM templates provided by Sitecore click here. You will get all the templates which can be deployed in Azure PaaS mode. As we are going for Sitecore 9.2.0 XP Single. We have to download this. Download all the files available over there and keep this in a separate folder.
There are two main files, one is azuredeploy.json which is containing the templates and the second one azuredeploy.parameters.json which needs to be filled up with the part of WDPs. We don’t need to touch the first file as this is only the template of the deployment process.
Before you start editing, upload all the downloaded template files into your Azure blob storage. You can put these in the same container with a separate folder. We named it as “XP”.
Open the azuredeploy.parameters.json file and start editing it as follows.
  1. {
  2. "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  3. "contentVersion": "1.0.0.0",
  4. "parameters": {
  5. "templateLinkBase": {
  6. "value": "<your storage account URL>/mnmsitecoredeployables/XP/"
  7. },
  8. "deploymentId": {
  9. "value": "<name of your deployment>"
  10. },
  11. "location": {
  12. "value": "<desired Azure location>"
  13. },
  14. "licenseXml": {
  15. "value": "<your storage account URL>/mnmsitecoredeployables/license.xml"
  16. },
  17. "sitecoreadminpassword":{
  18. "value":"<your strong password>"
  19. },
  20. "sqlServerLogin": {
  21. "value": "<your username>"
  22. },
  23. "sqlServerPassword": {
  24. "value": "<your strong password>"
  25. },
  26. "siMsDeployPackageUrl": {
  27. "value": "<your storage account URL>/mnmsitecoredeployables/Sitecore.IdentityServer.3.0.0-r00211.scwdp.zip"
  28. },
  29. "singleMsDeployPackageUrl": {
  30. "value": "<your storage account URL>/mnmsitecoredeployables/Sitecore 9.2.0 rev. 002893 (Cloud)_single.scwdp.zip"
  31. },
  32. "xcSingleMsDeployPackageUrl": {
  33. "value": "<your storage account URL>/mnmsitecoredeployables/Sitecore 9.2.0 rev. 002893 (Cloud)_xp0xconnect.scwdp.zip"
  34. },
  35. "authCertificateBlob": {
  36. "value": ""
  37. },
  38. "authCertificatePassword": {
  39. "value": "secret"
  40. },
  41. "allowInvalidClientCertificates": {
  42. "value": true
  43. }
  44. }
  45. }
Put all the data as described in the template.
  1. "allowInvalidClientCertificates": {
  2. "type": "bool",
  3. "defaultValue": false
  4. }
Now, save the files and create a new self-signed certificate for our deployment.

Create a self-signed certificate

To create a new self-signed certificate open your Powershell command prompt and execute the below command.
  1. ## Create the Certificate
  2. $thumbprint = (New-SelfSignedCertificate `
  3. -Subject "CN=$env:COMPUTERNAME @ Sitecore, Inc." `
  4. -Type SSLServerAuthentication `
  5. -FriendlyName "$env:USERNAME Certificate").Thumbprint
  6. $certificateFilePath = "D:\Temp\$thumbprint.pfx"
  7. Export-PfxCertificate `
  8. -cert cert:\LocalMachine\MY\$thumbprint `
  9. -FilePath "$certificateFilePath" `
  10. -Password (Read-Host -Prompt "Enter password that would protect the certificate" -AsSecureString)
  11. ## To generate Base64 file [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes('D:\temp\SitecoreRootCert.pfx'))
The last line will provide you a blob string of the generated certificate. Copy the string and paste it in your azuredeploy.parameter.json file. Place it as a value of authCertificateBlob.

Run Powershell to deploy the Azure resources

Follow the below steps to run the Powershell scripts,
But in your Azure portal, you will track all the updates. Go to your resource group and there, you can see how many resources have been processed and how many are in progress.
After successful installation, in the command prompt, you can see the details of all the created resources.
Go to the web app service in your Azure account. Open the web app and you can see the welcome page of Sitecore. By default, the Sitecore admin username will be “admin”. Login with the credentials and enjoy.