diff --git a/tooling/generate-templates/templates/arm/log.json b/tooling/generate-templates/templates/arm/log.json index b3371f4d5..36f95f5af 100644 --- a/tooling/generate-templates/templates/arm/log.json +++ b/tooling/generate-templates/templates/arm/log.json @@ -9,13 +9,6 @@ "description": "Name of the alert" } }, - "location": { - "type": "string", - "minLength": 1, - "metadata": { - "description": "Location of the alert" - } - }, "alertDescription": { "type": "string", "defaultValue": "##DESCRIPTION##", @@ -210,7 +203,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "apiVersion": "2021-08-01", "name": "[parameters('alertName')]", - "location": "[parameters('location')]", + "location": "[resourceGroup().location]", "tags": { "_deployed_by_amba": true }, @@ -229,9 +222,7 @@ "query": "[parameters('query')]", "metricMeasureColumn": "[parameters('metricMeasureColumn')]", "resourceIdColumn": "[parameters('resourceIdColumn')]", - "dimensions": [ - ##DIMENSIONS## - ], + "dimensions": ##DIMENSIONS##, "operator": "[parameters('operator')]", "threshold": "[parameters('threshold')]", "timeAggregation": "[parameters('timeAggregation')]", diff --git a/tooling/generate-templates/templates/arm/metric-dynamic.json b/tooling/generate-templates/templates/arm/metric-dynamic.json index 28e1cf149..02239df13 100644 --- a/tooling/generate-templates/templates/arm/metric-dynamic.json +++ b/tooling/generate-templates/templates/arm/metric-dynamic.json @@ -188,9 +188,7 @@ "criterionType": "DynamicThresholdCriterion", "name": "1st criterion", "metricName": "##METRIC_NAME##", - "dimensions": [ - ##DIMENSIONS## - ], + "dimensions": ##DIMENSIONS##, "operator": "[parameters('operator')]", "alertSensitivity": "[parameters('alertSensitivity')]", "failingPeriods": { diff --git a/tooling/generate-templates/templates/arm/metric-static.json b/tooling/generate-templates/templates/arm/metric-static.json index 73a780eb0..3b964b322 100644 --- a/tooling/generate-templates/templates/arm/metric-static.json +++ b/tooling/generate-templates/templates/arm/metric-static.json @@ -171,9 +171,7 @@ { "name": "1st criterion", "metricName": "##METRIC_NAME##", - "dimensions": [ - ##DIMENSIONS## - ], + "dimensions": ##DIMENSIONS##, "operator": "[parameters('operator')]", "threshold": "[parameters('threshold')]", "timeAggregation": "[parameters('timeAggregation')]", diff --git a/tooling/generate-templates/templates/bicep/log.bicep b/tooling/generate-templates/templates/bicep/log.bicep index e154f11bc..3e8a36485 100644 --- a/tooling/generate-templates/templates/bicep/log.bicep +++ b/tooling/generate-templates/templates/bicep/log.bicep @@ -2,10 +2,6 @@ @minLength(1) param alertName string -@description('Location of the alert') -@minLength(1) -param location string - @description('Description of alert') param alertDescription string = '##DESCRIPTION##' @@ -119,7 +115,7 @@ param telemetryOptOut string = 'No' resource alert 'Microsoft.Insights/scheduledQueryRules@2021-08-01' = { name: alertName - location: location + location: resourceGroup().location tags: { _deployed_by_amba: 'true' } @@ -138,8 +134,7 @@ resource alert 'Microsoft.Insights/scheduledQueryRules@2021-08-01' = { query: query metricMeasureColumn: metricMeasureColumn resourceIdColumn: resourceIdColumn - dimensions: [##DIMENSIONS## - ] + dimensions: [##DIMENSIONS##] operator: operator threshold: threshold timeAggregation: timeAggregation diff --git a/tooling/generate-templates/templates/bicep/metric-dynamic.bicep b/tooling/generate-templates/templates/bicep/metric-dynamic.bicep index fb68bd096..634eb0fc8 100644 --- a/tooling/generate-templates/templates/bicep/metric-dynamic.bicep +++ b/tooling/generate-templates/templates/bicep/metric-dynamic.bicep @@ -116,7 +116,7 @@ resource metricAlert 'Microsoft.Insights/metricAlerts@2018-03-01' = { criterionType: 'DynamicThresholdCriterion' name: '1st criterion' metricName: '##METRIC_NAME##' - dimensions: ##DIMENSIONS## + dimensions: [##DIMENSIONS##] operator: operator alertSensitivity: alertSensitivity failingPeriods: { diff --git a/tooling/generate-templates/templates/bicep/metric-static.bicep b/tooling/generate-templates/templates/bicep/metric-static.bicep index 1258b56af..3a097271f 100644 --- a/tooling/generate-templates/templates/bicep/metric-static.bicep +++ b/tooling/generate-templates/templates/bicep/metric-static.bicep @@ -107,7 +107,7 @@ resource metricAlert 'Microsoft.Insights/metricAlerts@2018-03-01' = { { name: '1st criterion' metricName: '##METRIC_NAME##' - dimensions: ##DIMENSIONS## + dimensions: [##DIMENSIONS##] operator: operator threshold: threshold timeAggregation: timeAggregation