-
-
Save johndowns/e0d42eab11da6d446a080c09e3e29402 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": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"applicationInsightsLocation": { | |
"type": "string", | |
"defaultValue": "westus2", | |
"allowedValues": [ | |
"eastus", | |
"southcentralus", | |
"westus2", | |
"northeurope", | |
"westeurope", | |
"southeastasia" | |
], | |
"metadata": { | |
"description": "The location in which to deploy Application Insights, since it supports a subset of Azure regions." | |
} | |
}, | |
"alertsEmailAddress": { | |
"type": "string", | |
"minLength": 1, | |
"metadata": { | |
"description": "The email address to which alerts should be sent." | |
} | |
} | |
}, | |
"variables": { | |
"applicationInsightsName": "AppInsights", | |
"applicationInsightsSmartDetections": [ | |
"slowpageloadtime", | |
"slowserverresponsetime", | |
"longdependencyduration", | |
"degradationinserverresponsetime", | |
"degradationindependencyduration" | |
] | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('applicationInsightsName')]", | |
"type": "Microsoft.Insights/components", | |
"apiVersion": "2014-04-01", | |
"location": "[parameters('applicationInsightsLocation')]", | |
"kind": "other", | |
"properties": { | |
"applicationId": "[variables('applicationInsightsName')]" | |
} | |
}, | |
{ | |
"comments": "Reconfigure Application Insights' default alerts to go to the right place", | |
"name": "[concat(variables('applicationInsightsName'), '/', variables('applicationInsightsSmartDetections')[copyIndex()])]", | |
"type": "Microsoft.Insights/components/proactiveDetectionConfigs", | |
"location": "[resourceGroup().location]", | |
"apiVersion": "2018-05-01-preview", | |
"copy": { | |
"name": "applicationInsightsSmartDetections", | |
"count": "[length(variables('applicationInsightsSmartDetections'))]" | |
}, | |
"properties": { | |
"name": "[variables('applicationInsightsSmartDetections')[copyIndex()]]", | |
"sendEmailsToSubscriptionOwners": false, | |
"customEmails": [ | |
"[parameters('alertsEmailAddress')]" | |
] | |
}, | |
"dependsOn": [ | |
"[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment