Skip to content

Commit 95c87e4

Browse files
committed
Separated sample service health alert ARM template from activity log
1 parent 5c75b92 commit 95c87e4

File tree

3 files changed

+105
-82
lines changed

3 files changed

+105
-82
lines changed

articles/azure-monitor/alerts/resource-manager-alerts-activity-log.md

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: abbyweisberg
88
ms.date: 12/28/2022
99
---
1010

11-
# Resource Manager template samples for activity log alert rules in Azure Monitor
11+
# Resource Manager template samples for Azure Monitor activity log alert rules
1212

1313
This article includes samples of [Azure Resource Manager templates](../../azure-resource-manager/templates/syntax.md) to create and configure activity log alerts in Azure Monitor.
1414

@@ -99,87 +99,6 @@ This example sets the condition to the **Administrative** category:
9999
}
100100
```
101101

102-
## Template to send activity log alerts on service notifications
103-
The following template creates an action group with an email target and enables all service health notifications for the target subscription. Save this template as `CreateServiceHealthAlert.json`.
104-
105-
```json
106-
{
107-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
108-
"contentVersion": "1.0.0.0",
109-
"parameters": {
110-
"actionGroups_name": {
111-
"type": "string",
112-
"defaultValue": "SubHealth"
113-
},
114-
"activityLogAlerts_name": {
115-
"type": "string",
116-
"defaultValue": "ServiceHealthActivityLogAlert"
117-
},
118-
"emailAddress": {
119-
"type": "string"
120-
}
121-
},
122-
"variables": {
123-
"alertScope": "[format('/subscriptions/{0}', subscription().subscriptionId)]"
124-
},
125-
"resources": [
126-
{
127-
"type": "microsoft.insights/actionGroups",
128-
"apiVersion": "2019-06-01",
129-
"name": "[parameters('actionGroups_name')]",
130-
"location": "Global",
131-
"properties": {
132-
"groupShortName": "[parameters('actionGroups_name')]",
133-
"enabled": true,
134-
"emailReceivers": [
135-
{
136-
"name": "[parameters('actionGroups_name')]",
137-
"emailAddress": "[parameters('emailAddress')]"
138-
}
139-
],
140-
"smsReceivers": [],
141-
"webhookReceivers": []
142-
}
143-
},
144-
{
145-
"type": "microsoft.insights/activityLogAlerts",
146-
"apiVersion": "2017-04-01",
147-
"name": "[parameters('activityLogAlerts_name')]",
148-
"location": "Global",
149-
"properties": {
150-
"scopes": [
151-
"[variables('alertScope')]"
152-
],
153-
"condition": {
154-
"allOf": [
155-
{
156-
"field": "category",
157-
"equals": "ServiceHealth"
158-
},
159-
{
160-
"field": "properties.incidentType",
161-
"equals": "Incident"
162-
}
163-
]
164-
},
165-
"actions": {
166-
"actionGroups": [
167-
{
168-
"actionGroupId": "[resourceId('microsoft.insights/actionGroups', parameters('actionGroups_name'))]",
169-
"webhookProperties": {}
170-
}
171-
]
172-
},
173-
"enabled": true
174-
},
175-
"dependsOn": [
176-
"[resourceId('microsoft.insights/actionGroups', parameters('actionGroups_name'))]"
177-
]
178-
}
179-
]
180-
}
181-
```
182-
183102
## Next steps
184103

185104
- [Get other sample templates for Azure Monitor](../resource-manager-samples.md).
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Resource Manager template samples for service health alerts
3+
description: Sample Azure Resource Manager templates to deploy Azure Monitor service health alerts.
4+
ms.topic: sample
5+
ms.custom: devx-track-arm-template
6+
author: AbbyMSFT
7+
ms.author: abbyweisberg
8+
ms.date: 12/25/2023
9+
---
10+
11+
# Resource Manager template samples for Azure Monitor service health alert rules
12+
13+
This article includes samples of [Azure Resource Manager templates](../../azure-resource-manager/templates/syntax.md) to create and configure service health alerts in Azure Monitor.
14+
15+
[!INCLUDE [azure-monitor-samples](../../../includes/azure-monitor-resource-manager-samples.md)]
16+
17+
18+
## Template to send service health alerts
19+
The following template creates an action group with an email target and enables all service health notifications for the target subscription. Save this template as `CreateServiceHealthAlert.json`.
20+
21+
```json
22+
{
23+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
24+
"contentVersion": "1.0.0.0",
25+
"parameters": {
26+
"actionGroups_name": {
27+
"type": "string",
28+
"defaultValue": "SubHealth"
29+
},
30+
"activityLogAlerts_name": {
31+
"type": "string",
32+
"defaultValue": "ServiceHealthActivityLogAlert"
33+
},
34+
"emailAddress": {
35+
"type": "string"
36+
}
37+
},
38+
"variables": {
39+
"alertScope": "[format('/subscriptions/{0}', subscription().subscriptionId)]"
40+
},
41+
"resources": [
42+
{
43+
"type": "microsoft.insights/actionGroups",
44+
"apiVersion": "2019-06-01",
45+
"name": "[parameters('actionGroups_name')]",
46+
"location": "Global",
47+
"properties": {
48+
"groupShortName": "[parameters('actionGroups_name')]",
49+
"enabled": true,
50+
"emailReceivers": [
51+
{
52+
"name": "[parameters('actionGroups_name')]",
53+
"emailAddress": "[parameters('emailAddress')]"
54+
}
55+
],
56+
"smsReceivers": [],
57+
"webhookReceivers": []
58+
}
59+
},
60+
{
61+
"type": "microsoft.insights/activityLogAlerts",
62+
"apiVersion": "2017-04-01",
63+
"name": "[parameters('activityLogAlerts_name')]",
64+
"location": "Global",
65+
"properties": {
66+
"scopes": [
67+
"[variables('alertScope')]"
68+
],
69+
"condition": {
70+
"allOf": [
71+
{
72+
"field": "category",
73+
"equals": "ServiceHealth"
74+
},
75+
{
76+
"field": "properties.incidentType",
77+
"equals": "Incident"
78+
}
79+
]
80+
},
81+
"actions": {
82+
"actionGroups": [
83+
{
84+
"actionGroupId": "[resourceId('microsoft.insights/actionGroups', parameters('actionGroups_name'))]",
85+
"webhookProperties": {}
86+
}
87+
]
88+
},
89+
"enabled": true
90+
},
91+
"dependsOn": [
92+
"[resourceId('microsoft.insights/actionGroups', parameters('actionGroups_name'))]"
93+
]
94+
}
95+
]
96+
}
97+
```
98+
99+
## Next steps
100+
101+
- [Get other sample templates for Azure Monitor](../resource-manager-samples.md).
102+
- [Learn more about alert rules](./alerts-overview.md).

articles/azure-monitor/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,8 @@ items:
14431443
href: alerts/resource-manager-alerts-metric.md
14441444
- name: Activity log alert rules
14451445
href: alerts/resource-manager-alerts-activity-log.md
1446+
- name: Service health alert rules
1447+
href: alerts/resource-manager-alerts-service-health.md
14461448
- name: Resource health alert rules
14471449
href: alerts/resource-manager-alerts-resource-health.md
14481450
- name: Action groups

0 commit comments

Comments
 (0)