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": ""
}
}
}
]
}
}
},