Skip to content

Commit

Permalink
Merge pull request #503 from feliasson/main
Browse files Browse the repository at this point in the history
Fixes bug in `dimensions` property for metric & log alerts generation for Bicep templates
  • Loading branch information
judyer28 authored Feb 11, 2025
2 parents 4617cb9 + c2b95f6 commit 4b9ef51
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tooling/generate-templates/generate-templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def main():
values: [{",".join(values)}]
}}""")

bicep_template = bicep_template.replace("##DIMENSIONS##", "".join(dimensions))
bicep_template = bicep_template.replace("##DIMENSIONS##", "[" + "".join(dimensions) + "]")
else:
arm_template = arm_template.replace("##DIMENSIONS##", "[]")
bicep_template = bicep_template.replace("##DIMENSIONS##", "[]")
Expand Down
2 changes: 1 addition & 1 deletion tooling/generate-templates/templates/bicep/log.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,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
Expand Down

0 comments on commit 4b9ef51

Please sign in to comment.