write an arm template that creates a metric alert rule that monitors the response time of a webapp and fires an alert if the response time exceeds 1 second of average

Avishek Das 0 Reputation points
2023-03-02T11:33:41.18+00:00

I want to write an arm template that creates a metric alert rule that monitors the response time of a web app and fires an alert if the response time exceeds 1 second of average response time. I have set up the web test using arm template already. Which is given below, Now I want to create a metric alert with webtestavailability and check if the webtest returns a response time which is 1 second higher than the average response time and then fire an alert to a specified action group. I have the action group created allready.

{
              "type": "microsoft.insights/webtests",
              "apiVersion": "2018-05-01-preview",
              "name": "ping-insights-backoffice-experience",
              "location": "westeurope",
              "tags": {
                "hidden-link:/subscriptions/bd95807c-691f-4f36-8ce3-f30d921b1694/resourceGroups/backoffice-experience/providers/microsoft.insights/components/insights-backoffice-experience": "Resource",
                "applicationService": "BoX - Backoffice experience - PROD",
                "businessUnit": "BT Checkout Boxers",
                "environment": "prod",
                "fabObject": "10952",
                "supportedBy": "boui@hm.com"
              },
              "properties": {
                "SyntheticMonitorId": "ping-insights-backoffice-experience",
                "Name": "Production Ping",
                "Enabled": true,
                "Frequency": 300,
                "Timeout": 120,
                "Kind": "ping",
                "RetryEnabled": true,
                "Locations": [
                  {
                    "Id": "emea-se-sto-edge"
                  },
                  {
                    "Id": "emea-gb-db3-azr"
                  },
                  {
                    "Id": "emea-ch-zrh-edge"
                  },
                  {
                    "Id": "us-va-ash-azr"
                  },
                  {
                    "Id": "apac-hk-hkn-azr"
                  }
                ],
                "Configuration": {
                  "WebTest": ""
                }
              }
            },
            {
              "apiVersion": "2018-05-01-preview",
              "name": "test-backend-availability-insights-backoffice-experience",
              "type": "microsoft.insights/webtests",
              "location": "westeurope",
              "tags": {
                "hidden-link:/subscriptions/bd95807c-691f-4f36-8ce3-f30d921b1694/resourceGroups/Backoffice-Experience/providers/microsoft.insights/components/Insights-Backoffice-Experience": "Resource",
                "applicationService": "BoX - Backoffice experience - PROD",
                "businessUnit": "BT Checkout Boxers",
                "environment": "prod",
                "fabObject": "10952",
                "supportedBy": "boui@hm.com"
              },
              "properties": {
                "SyntheticMonitorId": "test-backend-availability-insights-backoffice-experience",
                "Name": "Test Backend Availability",
                "Description": "",
                "Enabled": true,
                "Frequency": 300,
                "Timeout": 120,
                "Kind": "ping",
                "RetryEnabled": true,
                "Locations": [
                  {
                    "Id": "emea-nl-ams-azr"
                  },
                  {
                    "Id": "emea-se-sto-edge"
                  },
                  {
                    "Id": "emea-gb-db3-azr"
                  },
                  {
                    "Id": "apac-hk-hkn-azr"
                  },
                  {
                    "Id": "us-fl-mia-edge"
                  }
                ],
                "Configuration": {
                  "WebTest": ""
                }
              }
            }
          ]
        }
      }
    },
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,018 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,026 Reputation points Microsoft Employee
    2023-03-10T19:27:33.1233333+00:00

    Hi @Avishek Das

    Apologies for the delayed response. You aren't the first person to encounter this issue and as suggested, it's best to create the web availability test in the portal and export the XML scheme. We've sent word to the product group that the documentation needs to be improved to cover this gap but unfortunately, we don't have a timeline for that.

    0 comments No comments