Deploy a new Sitecore instance on Azure with Azure Monitoring and Alerts Basic

Abstract

Identify, measure, and evaluate app performance with Azure Monitoring and Alerts Basic when you deploy Sitecore on Azure.

The Azure Monitoring and Alerts Basic module uses Azure Monitor to track whether specific resources are performing within acceptable boundaries. Azure Monitor is a tool that combines Log Analytics and Application Insights to collect and analyse telemetry so you can better understand and maximize the performance of your applications. Different types of resources have different thresholds and different time periods to check for. By default, Azure Monitoring and Alerts Basic creates a number of alerts specifically for each of the Sitecore topologies. 

Before you can deploy a Sitecore environment on Azure with Azure Monitoring and Alerts Basic, you must:

To add the Azure Monitoring and Alerts Basic module, you must inject it into the parameters.json file for your specific topology. To inject the module into the parameters.json file:

  1. Ensure you have a parameters.json file for your Sitecore environment.

  2. In the parameters.json file, add the modules parameter.

  3. Also in the parameters.json file for your Sitecore configuration, insert the configuration snippet, for the Monitoring module, into the modules parameter. Use the snippet from the next section: Configure the Monitoring module.

To integrate the deployment of the Azure Monitoring and Alerts Basic module into the Sitecore environment deployment,

  1. In the azuredeploy.parameters.json file, add the following snippet to the modules parameter.

    {… , 
        "modules": { 
            "value": { 
                "items": [ 
                    { 
                        "name": "monitoring", 
                        "templateLink": "<url of Azure Monitoring and Alerts Basic  azuredeploy.json>", 
                        "parameters": { 
                               "omsWorkspaceMetricsRetentionDays": <days>, 
                               "omsWorkspaceAlertRecipients": "<email address for alert recipient>", 
                               "omsWorkspaceLocation": "<Australia Southeast or Canada Central or Central India or East US or Japan East or Southeast Asia or UK South or West Europe>", 
                               "applicationInsightsLocation": "<location>" 
         
                        } 
                    } 
                ] 
            } 
        } 
    }
    
  2. Populate the parameters for the Azure Monitoring and Alerts Basic module.

    Parameter

    Instructions

    templateLink

    In Github, go to the Monitoring module, and use the URL of the Azure Monitoring and Alerts Basic template, azuredeploy.json. Alternatively, you can download the Azure Monitoring and Alerts Basic ARM templates and upload them to your storage account.

    OmsWorkspaceMetricsRetentionDays

    Enter the custom metrics retention days. The value in days = between 30 to 730.

    OmsWorkspaceAlertRecipients

    To receive alerts, enter your email address. If you want to use more than one email address, then use a semi colon ";" as a separator.

    OmsWorkspaceLocation

    Specify the location where you want to provision your OMS. Currently, the available locations are: Australia Southeast, Canada Central, Central India, East US, Japan East, Southeast Asia, UK South, West Europe.

    applicationInsightsLocation

    Specify the location where you want Application Insights provisioned. Currently the available locations are: East US, North Europe, Southeast Asia, South Central US, West Europe, West US 2.

To invoke the PowerShell deployment command and initiate provisioning:

  1. In PowerShell, open the Azure Toolkit folder, and load the Azure Toolkit module: Import-Module.\tools\Sitecore.Cloud.Cmdlets.psm1-Verbose.

  2. Use the command Add-AzureRMAccount, to add an Azure account to your PowerShell session.

  3. If you have access to multiple subscriptions, select the subscription that you want to deploy into. For example: Set-AzureRMContext -SubscriptionName "<name of your subscription>".

  4. To start provisioning, use the Start-SitecoreAzureDeployment commandlet:

    Start-SitecoreAzureDeployment [-location] <String> [-Name] <String> [-ArmTemplateUrl] <String> [-ArmParametersPath] <String> [-LicenseXmlPath] <String> [-SetKeyValue] <Hashtable>

    The Start-SitecoreAzureDeployment commandlet uses the following parameters:

    Parameter

    Description

    Location

    The Azure datacenter where you want to deploy your resources from. The Azure datacenter compatibility table lists the Microsoft Azure datacenters that the Sitecore Experience Platform supports deployment to.

    Name

    The name of the resource group for your new environment. The name can refer to a new or existing resource group, and is usually the same as the deployment ID.

    ArmTemplateUrl

    The URL of the ARM template file for the environment configuration that you want to deploy.

    ArmParametersPath

    The local path to the populated parameters.json file for the template that you selected.

    LicenseXmlPath

    The path to the Sitecore license file that you want to deploy to the environment.

    SetKeyValue

    (Optional) Use this parameter in a script to deploy several environments:

    • Use a common set of default parameter values in the azuredeploy.parameters.json file.

    • Supply environment specific parameter values in the command line.

    The value of this parameter is a hashtable that contains a subset of parameters described in the azuredeploy.parameters.json file. Any values that you specify in the command line for this parameter override the values specified in the azuredeploy.parameters.json file For example, to set or override the value in the deploymentId parameter, enter:

    -SetKeyValue @{ "deploymentId" = "<new value>" }

Deployment example

The following PowerShell script demonstrates how to use Sitecore Azure Toolkit to deploy Sitecore to Azure with the Azure Monitoring and Alerts Basic module.

# Deployment joson file path
$ArmTemplateUrl = "<azuredeploy.json URI>" 

# Azure template parameters path
$ArmParametersPath = "<Local Path for *.parameters.json>" 

# Sitecore Azure toolkit Path 
$SCSDK = "<Directory path to Azure Toolkit>" 

# Name of resource group
$Name = "< Resource group name>"   

# Sitecore License File
$LicenseFile = "< LicenseFile >"  

#Azure Subscriptionid
$SubscriptionId = "< AzureSubscriptionId >" 

# Location of deployment
$Region = "< Location of deployment >"   

# Import Sitecore SDK module 
Import-Module $SCSDK\Sitecore.Cloud.Cmdlets.psm1   

# Select Azure Account 
Add-AzureRMAccount 
Set-AzureRMContext -SubscriptionId $SubscriptionId


# Deploy Sitecore 
Start-SitecoreAzureDeployment -Name $Name -Region $Region -ArmTemplateUrl $ArmTemplateUrl -ArmParametersPath $ArmParametersPath -LicenseXmlPath $LicenseFile

If you no longer require Azure Azure Monitor you can remove it.

Important

If you only want to remove the Azure Monitor resource group, do not delete the resource group it is within, otherwise you will also remove Sitecore. If this happens, you can Invoke the deployment command to redeploy Sitecore.

To delete the Application Insights resource group:

  1. In the Microsoft Azure portal, click Resource groups to see all available resource groups.

  2. Click your deployed resource group to see all of the available resources for that group, then in Overview, select Application Insights.

    The Azure resource group Application Insights.
  3. In the menu on the left, click Availability, then Details to see all the Tier 4 alerts, the Availability test alert, or the Ping test alert.

  4. Under Available tests summary, to the right of the test you want to delete, click (...), and Delete.

    Delete the Availability test.

To delete the associated metric alerts:

  1. In the Microsoft Azure portal, click Monitor, then Alerts.

    Click Manage alerts rules.
  2. Click Manage alert rules, then select the appropriate subscription and resource group to see all the Tier 1, Tier 2, and Tier 3 metric alerts.

    See the Tier metric alerts.
  3. Select the checkbox next to the metric alert that you want to delete, then click Delete.

    Delete a monitor metric alert.