This article provides an example of a creation of an alert rule which would make the Azure integration has active Activity Log Alerts test pass.
Create the Rule
- Rules can be created from the Monitor service in Azure, or from the Alerts option in a specific Azure resource.
- Select Create and then Alert Rule
- The next step is choosing the scope for the alert. In this example, we choose the entire subscription and then select Apply.
- Next, a condition must be entered, and a signal must be chosen. The Azure integration has an active Activity Log Alerts test that looks for alerts with “Resource health” or “Activity log” as signal types. Therefore, we choose “Resource health” as the signal in this example.
- After your condition is chosen, select Apply.
- Set any actions that make sense for your organization on the Actions tab
- On the details tab, select the Resource Group that will host the Alert rule and name the Alert rule.
- Click Review and Create to create the alert
Here is an example JSON of the alert that will allow the test to pass:
{
"id": "/subscriptions/AAAAAAAA-BBBB-CCCC-DDDD-123456789ABC/resourceGroups/resource-group-name/providers/microsoft.insights/activitylogalerts/SubscriptionResourceHealth",
"name": "SubscriptionResourceHealth",
"type": "Microsoft.Insights/ActivityLogAlerts",
"location": "global",
"tags": {},
"properties": {
"scopes": [
"/subscriptions/AAAAAAAA-BBBB-CCCC-DDDD-123456789ABC"
],
"condition": {
"allOf": [
{
"field": "category",
"equals": "ResourceHealth"
}
]
},
"actions": {
"actionGroups": []
},
"enabled": true,
"description": ""
}
}