-
-
Save johndowns/51821e121ccae0e2da8255cef6008272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"alertEmailAddress": { | |
"type": "string", | |
"metadata": { | |
"description": "The email address to receive any alerts." | |
} | |
} | |
}, | |
"variables": { | |
"actionGroupName": "MyApplicationWarnings" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('actionGroupName')]", | |
"type": "Microsoft.Insights/actionGroups", | |
"location": "global", | |
"apiVersion": "2018-03-01", | |
"properties": { | |
"groupShortName": "Activity Log", | |
"enabled": true, | |
"emailReceivers": [ | |
{ | |
"name": "Administrator", | |
"emailAddress": "[parameters('alertEmailAddress')]" | |
} | |
] | |
} | |
}, | |
{ | |
"name": "ResourceGroupDeleted", | |
"type": "Microsoft.Insights/activityLogAlerts", | |
"location": "global", | |
"apiVersion": "2017-04-01", | |
"properties": { | |
"description": "Resource Group Deleted", | |
"enabled": true, | |
"scopes": [ | |
"[subscription().id]" | |
], | |
"condition": { | |
"allOf": [ | |
{ | |
"field": "category", | |
"equals": "Administrative" | |
}, | |
{ | |
"field": "operationName", | |
"equals": "Microsoft.Resources/subscriptions/resourceGroups/delete" | |
} | |
] | |
}, | |
"actions": { | |
"actionGroups": [ | |
{ | |
"actionGroupId": "[resourceId('Microsoft.Insights/actionGroups', variables('actionGroupName'))]" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"name": "FailedDeployment", | |
"type": "Microsoft.Insights/activityLogAlerts", | |
"location": "global", | |
"apiVersion": "2017-04-01", | |
"properties": { | |
"description": "Failed ARM Deployment", | |
"enabled": true, | |
"scopes": [ | |
"[resourceGroup().id]" | |
], | |
"condition": { | |
"allOf": [ | |
{ | |
"field": "category", | |
"equals": "Administrative" | |
}, | |
{ | |
"field": "resourceType", | |
"equals": "Microsoft.Resources/deployments" | |
}, | |
{ | |
"field": "status", | |
"equals": "Failed" | |
} | |
] | |
}, | |
"actions": { | |
"actionGroups": [ | |
{ | |
"actionGroupId": "[resourceId('Microsoft.Insights/actionGroups', variables('actionGroupName'))]" | |
} | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment