---
title: "Deploy a new Sitecore instance on Azure with Azure Monitoring and Alerts Basic"
slug: "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."
---
# Deploy a new Sitecore instance on Azure with Azure Monitoring and Alerts Basic

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 analyze 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. 

<details>
<summary><h2>Prerequisites</h2></summary>

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

- Work through [Getting started with the Sitecore Azure Toolkit](https://doc.sitecore.com/xp/en/developers/sat/30/sitecore-azure-toolkit/getting-started-with-the-sitecore-azure-toolkit.html).
- Work through [Deploy a new Sitecore environment to the Azure App service](https://doc.sitecore.com/xp/en/developers/sat/30/sitecore-azure-toolkit/deploy-a-new-sitecore-environment-to-azure-app-service.html), Specifically work through the following sections:
    - *Plan your environment*
    - *Prepare WebDeploy packages*
    - *Download and configure an environment template*
- Install the latest version of PowerShell (minimum 6.0.0) – To upgrade your PowerShell module, run:

    `Update-Module -Name AzureRM -RequiredVersion 6.0.0 -Force`

- (Optional if you require a fully functional application level monitoring solution) Application Insights.

</details>

<details>
<summary><h2>Add the Azure Monitoring and Alerts Basic module</h2></summary>

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](https://doc.sitecore.com/xp/en/developers/sat/30/sitecore-azure-toolkit/deploy-a-new-sitecore-environment-to-azure-app-service.html).
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*.

</details>

<details>
<summary><h2>Configure the Monitoring module</h2></summary>

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.

    ```csharp
    {… ,
        "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": "<supported location>",
                               "applicationInsightsLocation": "<supported 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](https://github.com/Sitecore/Sitecore-Azure-Quickstart-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 log analytics. First [check which regions are supported](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=analysis-services,monitor). |
    | `applicationInsightsLocation` | Specify the location where you want to provision your Application Insights. First [check which regions are supported](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=analysis-services,monitor). |

</details>

<details>
<summary><h2>Invoke the deployment command</h2></summary>

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:

    ```text
    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](https://kb.sitecore.net/articles/617478) 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 deploymentIdparameter, enter:

    ```text
    -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

```

</details>

<details>
<summary><h2>Remove Azure Monitor from Sitecore</h2></summary>

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](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-manager/deploy-a-new-sitecore-instance-on-azure-with-azure-monitoring-and-alerts-basic.html#UUID-b44b85e1-2cc2-7680-3754-4101cbb15973_section-idm46026195801120 "Invoke the deployment command") to redeploy Sitecore.

### Delete the Application Insights availability alerts

To delete the Application Insights availability alerts:

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.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/AzureResourceGroup_AppInsights.png)

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.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/Delete_availability_test.png)

### Delete the associated metric alerts

To delete the associated metric alerts:

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

    ![Click Manage alerts rules.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/Monitor_overview.png)

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.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/SeeTheTierMetricAlerts.png)

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

    ![Delete a monitor metric alert.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/DeleteMonitorMetricAlert.png)

</details>

<details>
<summary><h2>Delete the Search Services Performance overview</h2></summary>

If you are using a Solr search provider with your Sitecore deployment, you must also delete the **Search Services Performance** view. To delete the Search Services Performance overview:

1. In your OMS workspace, click the **Performance Overview** tile.

    ![PerformanceOverviewTiles.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/PerformanceOverviewTiles.png)

2. In **Performance Overview**, click **Edit**.

    ![EditPerformanceOverview.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/EditPerformanceOverview.png)

3. In **View dashboard**, click on the **Search Services Performance** overview, then click **Delete view**.

    ![DeleteViewSearchServicesPerformance.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/sitecore-experience-manager/images/DeleteViewSearchServicesPerformance.png)

</details>