Skip to content

Commit 7db2632

Browse files
committed
Delete orphans and combine action group articles.
1 parent 4915caa commit 7db2632

File tree

5 files changed

+195
-4081
lines changed

5 files changed

+195
-4081
lines changed

.openpublishing.redirection.azure-monitor.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3867,6 +3867,21 @@
38673867
"redirect_url": "/azure/azure-monitor/alerts/alerts-metric-create-templates",
38683868
"redirect_document_id": false
38693869
},
3870+
{
3871+
"source_path_from_root": "/articles/azure-monitor/alerts/alerts-metric-create-templates.md",
3872+
"redirect_url": "/azure/azure-monitor/alerts/alerts-create-new-alert-rule",
3873+
"redirect_document_id": false
3874+
},
3875+
{
3876+
"source_path_from_root": "/articles/azure-monitor/alerts/action-groups-create-resource-manager-template.md",
3877+
"redirect_url": "/azure/azure-monitor/alerts/action-groups",
3878+
"redirect_document_id": false
3879+
},
3880+
{
3881+
"source_path_from_root": "/articles/azure-monitor/alerts/alerts-log-create-templates.md",
3882+
"redirect_url": "/azure/azure-monitor/alerts/alerts-create-new-alert-rule",
3883+
"redirect_document_id": false
3884+
},
38703885
{
38713886
"source_path_from_root": "/articles/azure-monitor/platform/alerts-metric-logs.md",
38723887
"redirect_url": "/azure/azure-monitor/alerts/alerts-metric-logs",

articles/azure-monitor/alerts/action-groups.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,181 @@ The following table describes the role membership requirements that are needed f
168168
> - To find common schema samples for all sample types, see [Common alert schema definitions for Test Action Group](./alerts-common-schema-test-action-definitions.md).
169169
> - To find non-common schema alert definitions, see [Non-common alert schema definitions for Test Action Group](./alerts-non-common-schema-definitions.md).
170170
171+
172+
## Create an action group with a Resource Manager template
173+
You can use an [Azure Resource Manager template](../../azure-resource-manager/templates/syntax.md) to configure action groups. Using templates, you can automatically set up action groups that can be reused in certain types of alerts. These action groups ensure that all the correct parties are notified when an alert is triggered.
174+
175+
The basic steps are:
176+
177+
1. Create a template as a JSON file that describes how to create the action group.
178+
179+
2. Deploy the template by using [any deployment method](../../azure-resource-manager/templates/deploy-powershell.md).
180+
181+
### Resource Manager templates for an action group
182+
183+
To create an action group using a Resource Manager template, you create a resource of the type `Microsoft.Insights/actionGroups`. Then you fill in all related properties. Here are two sample templates that create an action group.
184+
185+
First template, describes how to create a Resource Manager template for an action group where the action definitions are hard-coded in the template. Second template, describes how to create a template that takes the webhook configuration information as input parameters when the template is deployed.
186+
187+
```json
188+
{
189+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
190+
"contentVersion": "1.0.0.0",
191+
"parameters": {
192+
"actionGroupName": {
193+
"type": "string",
194+
"metadata": {
195+
"description": "Unique name (within the Resource Group) for the Action group."
196+
}
197+
},
198+
"actionGroupShortName": {
199+
"type": "string",
200+
"metadata": {
201+
"description": "Short name (maximum 12 characters) for the Action group."
202+
}
203+
}
204+
},
205+
"resources": [
206+
{
207+
"type": "Microsoft.Insights/actionGroups",
208+
"apiVersion": "2021-09-01",
209+
"name": "[parameters('actionGroupName')]",
210+
"location": "Global",
211+
"properties": {
212+
"groupShortName": "[parameters('actionGroupShortName')]",
213+
"enabled": true,
214+
"smsReceivers": [
215+
{
216+
"name": "contosoSMS",
217+
"countryCode": "1",
218+
"phoneNumber": "5555551212"
219+
},
220+
{
221+
"name": "contosoSMS2",
222+
"countryCode": "1",
223+
"phoneNumber": "5555552121"
224+
}
225+
],
226+
"emailReceivers": [
227+
{
228+
"name": "contosoEmail",
229+
"emailAddress": "[email protected]",
230+
"useCommonAlertSchema": true
231+
232+
},
233+
{
234+
"name": "contosoEmail2",
235+
"emailAddress": "[email protected]",
236+
"useCommonAlertSchema": true
237+
}
238+
],
239+
"webhookReceivers": [
240+
{
241+
"name": "contosoHook",
242+
"serviceUri": "http://requestb.in/1bq62iu1",
243+
"useCommonAlertSchema": true
244+
},
245+
{
246+
"name": "contosoHook2",
247+
"serviceUri": "http://requestb.in/1bq62iu2",
248+
"useCommonAlertSchema": true
249+
}
250+
],
251+
"SecurewebhookReceivers": [
252+
{
253+
"name": "contososecureHook",
254+
"serviceUri": "http://requestb.in/1bq63iu1",
255+
"useCommonAlertSchema": false
256+
},
257+
{
258+
"name": "contososecureHook2",
259+
"serviceUri": "http://requestb.in/1bq63iu2",
260+
"useCommonAlertSchema": false
261+
}
262+
],
263+
"eventHubReceivers": [
264+
{
265+
"name": "contosoeventhub1",
266+
"subscriptionId": "replace with subscription id GUID",
267+
"eventHubNameSpace": "contosoeventHubNameSpace",
268+
"eventHubName": "contosoeventHub",
269+
"useCommonAlertSchema": true
270+
}
271+
]
272+
}
273+
}
274+
],
275+
"outputs":{
276+
"actionGroupId":{
277+
"type":"string",
278+
"value":"[resourceId('Microsoft.Insights/actionGroups',parameters('actionGroupName'))]"
279+
}
280+
}
281+
}
282+
```
283+
284+
```json
285+
{
286+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
287+
"contentVersion": "1.0.0.0",
288+
"parameters": {
289+
"actionGroupName": {
290+
"type": "string",
291+
"metadata": {
292+
"description": "Unique name (within the Resource Group) for the Action group."
293+
}
294+
},
295+
"actionGroupShortName": {
296+
"type": "string",
297+
"metadata": {
298+
"description": "Short name (maximum 12 characters) for the Action group."
299+
}
300+
},
301+
"webhookReceiverName": {
302+
"type": "string",
303+
"metadata": {
304+
"description": "Webhook receiver service Name."
305+
}
306+
},
307+
"webhookServiceUri": {
308+
"type": "string",
309+
"metadata": {
310+
"description": "Webhook receiver service URI."
311+
}
312+
}
313+
},
314+
"resources": [
315+
{
316+
"type": "Microsoft.Insights/actionGroups",
317+
"apiVersion": "2021-09-01",
318+
"name": "[parameters('actionGroupName')]",
319+
"location": "Global",
320+
"properties": {
321+
"groupShortName": "[parameters('actionGroupShortName')]",
322+
"enabled": true,
323+
"smsReceivers": [
324+
],
325+
"emailReceivers": [
326+
],
327+
"webhookReceivers": [
328+
{
329+
"name": "[parameters('webhookReceiverName')]",
330+
"serviceUri": "[parameters('webhookServiceUri')]",
331+
"useCommonAlertSchema": true
332+
}
333+
]
334+
}
335+
}
336+
],
337+
"outputs":{
338+
"actionGroupResourceId":{
339+
"type":"string",
340+
"value":"[resourceId('Microsoft.Insights/actionGroups',parameters('actionGroupName'))]"
341+
}
342+
}
343+
}
344+
```
345+
171346
## Manage your action groups
172347

173348
After you create an action group, you can view it in the portal:

0 commit comments

Comments
 (0)