Sitecore XP1 On Azure - Deploy Using PowerShell

In this blog, we will discuss about the PowerShell Cmdlets that should be used to deploy the Sitecore XP instance to Azure.

Below is the list of files that I have placed in a folder.

Azure
My PowerShell code is available in the sitecoreazurexp.ps1 file. Below is the code.

  1. #Azure SubscriptionID  
  2.   
  3. $SubscriptionId = "Subscription id here";  
  4.  
  5. #Name of Resource Group. The DeploymentId in azuredeploy.parameters.json should also be the name of the Resource Group  
  6.   
  7. $Name = "xp1-rg";  
  8.  
  9. #Location of the Sitecore license file.  
  10.   
  11. $LicenseXmlPath = "license.xml";  
  12.  
  13. #Location of the ARM template file.  
  14.   
  15. $ArmTemplatePath = "azuredeploy.json";  
  16.  
  17. #location of the parameters.json file.  
  18.   
  19. $ArmParametersPath = "azuredeploy.parameters.json";  
  20.  
  21. #Name of Azure Location / Data Center  
  22.   
  23. $location = "EastUS";  
  24.  
  25. #Load the Azure Toolkit module  
  26.   
  27. Import-Module "D:\Sitecore\AzureXp1\Sitecore Azure Toolkit 1.0 rev. 161125\tools\Sitecore.Cloud.Cmdlets.psm1"  
  28.  
  29. #Add Azure account  
  30.   
  31. Add-AzureRMAccount  
  32.  
  33. #Select the subscription.  
  34.   
  35. Set-AzureRMContext -SubscriptionId $SubscriptionId  
  36.  
  37. #Start the deployment  
  38.   
  39. get-date;Start-SitecoreAzureDeployment -location $location -Name $Name -ArmTemplatePath $ArmTemplatePath -ArmParametersPath $ArmParametersPath -LicenseXmlPath $LicenseXmlPath -SetKeyValue @{} -Verbose;get-date   

The above commands along with the comments is self-explanatory.

Select the code and click on "Execute", as shown below.

Azure

This clicking will prompt you to provide the credentials of your Azure Subscription.

Azure

Provide the username and password and click on the "Sign in" button.

You can log into your subscription and navigate to the Resource Group and view the Essentials tab, as shown below.

Azure

Click on the "1 Deploying" to view the progress on the deployment.

Azure

If you have configured all the settings correctly, it would take approximately 25 minutes to successfully deploy the Sitecore XP1 instance on Azure App Services.

Let’s navigate to the Sitecore Content Management role.

Azure

That’s it. We have successfully deployed the Sitecore XP1 instance on Azure App Service.