With the classic alert migration to new alert.
I have a ping url "Microsoft.Insights/webtest" in Azure Availability Tests.
The old alert type is "Microsoft.Insights/alertrules".
The condition type is "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition".
The old metricName is "GSMT_AvRaW".
How to write this new alert(Near-realtime) in arm or how to write into webtests in arm?
When I add New Test in Availability, I can switch Alert Type Classic to Near-realtime.It will generate a Alert
And I can't add New Alert condition for the webtest, I can only Click the edit alert button to Edit the Alert. Because no Metric Type can be chosen in Condition when I add new Alert.
If you look at Resource Explorer and navigate to a manually created (near-realtime) alert, you should see the "critera" object defined like below. Here is a full example of a resource that seems to be working. Create some variables for each of your values:
{
"type": "Microsoft.Insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "[variables('alertName')]",
"location": "global",
"dependsOn": [],
"tags": {
"[concat('hidden-link:', variables('applicationInsightsResourceId'))]": "Resource",
"[concat('hidden-link:', variables('webtestResourceId'))]": "Resource"
},
"properties": {
"description": "[concat('Alert for ', parameters('availibilityTestName'))]",
"severity": 4,
"enabled": true,
"scopes": [
"[variables('webtestResourceId')]",
"[variables('applicationInsightsResourceId')]"
],
"evaluationFrequency": "PT5M",
"windowSize": "PT15M",
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "[variables('webtestResourceId')]",
"componentId": "[variables('applicationInsightsResourceId')]",
"failedLocationCount": 3
},
"actions": [
{
"actionGroupId": "[resourceId('microsoft.insights/actiongroups', 'webhook')]",
"webHookProperties": {
// Some properties to send to webhook
}
}
]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With