Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokib committed Nov 22, 2017
1 parent e8e9fd3 commit 78605ad
Show file tree
Hide file tree
Showing 2 changed files with 477 additions and 375 deletions.
76 changes: 76 additions & 0 deletions arm-templates/sqlDwAutoScaler/alert-template.json
@@ -0,0 +1,76 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionAppName": {
"type": "string"
},
"functionName": {
"type": "string"
},
"sqlDwId": {
"type": "string"
}
},
"variables": { },
"resources": [
{
"type": "Microsoft.Insights/alertRules",
"name": "ScaleDownSqlDw",
"apiVersion": "2016-03-01",
"location": "[resourceGroup().location]",
"properties": {
"name": "ScaleDownSqlDw",
"description": "Scales Down SQL DW based on DWU usage",
"isEnabled": true,
"condition": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
"dataSource": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[parameters('sqlDwId')]",
"metricName": "dwu_consumption_percent"
},
"operator": "LessThanOrEqual",
"threshold": "2",
"windowSize": "PT5M"
},
"actions": [{
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction",
"serviceUri": "[listsecrets(resourceId('Microsoft.Web/sites/functions', parameters('functionAppName'), parameters('functionName')),'2015-08-01').trigger_url]",
"properties": {}
}]
},
"dependsOn": [
]
},
{
"type": "Microsoft.Insights/alertRules",
"name": "ScaleUpSqlDw",
"apiVersion": "2016-03-01",
"location": "[resourceGroup().location]",
"properties": {
"name": "ScaleUpSqlDw",
"description": "Scales Up SQL DW based on DWU usage",
"isEnabled": true,
"condition": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
"dataSource": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[parameters('sqlDwId')]",
"metricName": "dwu_consumption_percent"
},
"operator": "GreaterThanOrEqual",
"threshold": "80",
"windowSize": "PT5M"
},
"actions": [{
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction",
"serviceUri": "[listsecrets(resourceId('Microsoft.Web/sites/functions', parameters('functionAppName'), parameters('functionName')),'2015-08-01').trigger_url]",
"properties": {}
}]
},
"dependsOn": [
]
}
]
}

0 comments on commit 78605ad

Please sign in to comment.