Skip to content

Commit 104427c

Browse files
feat: Scheduled-Query-Rule - Corrected misleading parameter name (#6481)
## Description Corrected misleading parameter name Closes #6478 ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | [![avm.res.insights.scheduled-query-rule](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.insights.scheduled-query-rule.yml/badge.svg?branch=users%2Falsehr%2F6478_suppressMinutes&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.insights.scheduled-query-rule.yml) ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [x] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation - [ ] Update to CI Environment or utilities (Non-module affecting changes)
1 parent 12b9c0c commit 104427c

File tree

11 files changed

+43
-36
lines changed

11 files changed

+43
-36
lines changed

avm/res/insights/scheduled-query-rule/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/insights/scheduled-query-rule/CHANGELOG.md).
44

5+
## 0.6.0
6+
7+
### Changes
8+
9+
- None
10+
11+
### Breaking Changes
12+
13+
- Renamed `suppressForMinutes` to resource-provider-aligned `muteActionsDuration` as the original name was misleading (considering that it supports more than just minutes)
14+
515
## 0.5.2
616

717
### Changes

avm/res/insights/scheduled-query-rule/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
279279
'<managedIdentityResourceId>'
280280
]
281281
}
282+
muteActionsDuration: 'PT5M'
282283
queryTimeRange: 'PT5M'
283284
roleAssignments: [
284285
{
@@ -303,7 +304,6 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
303304
autoResolved: true
304305
timeToResolve: 'PT5M'
305306
}
306-
suppressForMinutes: 'PT5M'
307307
tags: {
308308
Environment: 'Non-Prod'
309309
'hidden-title': 'This is visible in the resource name'
@@ -405,6 +405,9 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
405405
]
406406
}
407407
},
408+
"muteActionsDuration": {
409+
"value": "PT5M"
410+
},
408411
"queryTimeRange": {
409412
"value": "PT5M"
410413
},
@@ -435,9 +438,6 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
435438
"timeToResolve": "PT5M"
436439
}
437440
},
438-
"suppressForMinutes": {
439-
"value": "PT5M"
440-
},
441441
"tags": {
442442
"value": {
443443
"Environment": "Non-Prod",
@@ -519,6 +519,7 @@ param managedIdentities = {
519519
'<managedIdentityResourceId>'
520520
]
521521
}
522+
param muteActionsDuration = 'PT5M'
522523
param queryTimeRange = 'PT5M'
523524
param roleAssignments = [
524525
{
@@ -543,7 +544,6 @@ param ruleResolveConfiguration = {
543544
autoResolved: true
544545
timeToResolve: 'PT5M'
545546
}
546-
param suppressForMinutes = 'PT5M'
547547
param tags = {
548548
Environment: 'Non-Prod'
549549
'hidden-title': 'This is visible in the resource name'
@@ -605,8 +605,8 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
605605
alertDescription: 'My sample Alert'
606606
autoMitigate: false
607607
evaluationFrequency: 'PT5M'
608+
muteActionsDuration: 'PT5M'
608609
queryTimeRange: 'PT5M'
609-
suppressForMinutes: 'PT5M'
610610
tags: {
611611
Environment: 'Non-Prod'
612612
'hidden-title': 'This is visible in the resource name'
@@ -677,10 +677,10 @@ module scheduledQueryRule 'br/public:avm/res/insights/scheduled-query-rule:<vers
677677
"evaluationFrequency": {
678678
"value": "PT5M"
679679
},
680-
"queryTimeRange": {
680+
"muteActionsDuration": {
681681
"value": "PT5M"
682682
},
683-
"suppressForMinutes": {
683+
"queryTimeRange": {
684684
"value": "PT5M"
685685
},
686686
"tags": {
@@ -743,8 +743,8 @@ param scopes = [
743743
param alertDescription = 'My sample Alert'
744744
param autoMitigate = false
745745
param evaluationFrequency = 'PT5M'
746+
param muteActionsDuration = 'PT5M'
746747
param queryTimeRange = 'PT5M'
747-
param suppressForMinutes = 'PT5M'
748748
param tags = {
749749
Environment: 'Non-Prod'
750750
'hidden-title': 'This is visible in the resource name'
@@ -787,12 +787,12 @@ param windowSize = 'PT5M'
787787
| [`location`](#parameter-location) | string | Location for all resources. |
788788
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
789789
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. You can only configure either a system-assigned or user-assigned identities, not both. |
790+
| [`muteActionsDuration`](#parameter-muteactionsduration) | string | Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. If set, autoMitigate must be disabled. Relevant only for rules of the kind LogAlert. |
790791
| [`queryTimeRange`](#parameter-querytimerange) | string | If specified (in ISO 8601 duration format) then overrides the query time range. Relevant only for rules of the kind LogAlert. |
791792
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
792793
| [`ruleResolveConfiguration`](#parameter-ruleresolveconfiguration) | object | Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. Note, ResolveConfiguration can't be used together with AutoMitigate. |
793794
| [`severity`](#parameter-severity) | int | Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. |
794795
| [`skipQueryValidation`](#parameter-skipqueryvalidation) | bool | The flag which indicates whether the provided query should be validated or not. Relevant only for rules of the kind LogAlert. |
795-
| [`suppressForMinutes`](#parameter-suppressforminutes) | string | Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. If set, autoMitigate must be disabled. Relevant only for rules of the kind LogAlert. |
796796
| [`tags`](#parameter-tags) | object | Tags of the resource. |
797797
| [`targetResourceTypes`](#parameter-targetresourcetypes) | array | List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert. |
798798

@@ -1027,6 +1027,13 @@ The resource ID(s) to assign to the resource. Required if a user assigned identi
10271027
- Required: No
10281028
- Type: array
10291029

1030+
### Parameter: `muteActionsDuration`
1031+
1032+
Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. If set, autoMitigate must be disabled. Relevant only for rules of the kind LogAlert.
1033+
1034+
- Required: No
1035+
- Type: string
1036+
10301037
### Parameter: `queryTimeRange`
10311038

10321039
If specified (in ISO 8601 duration format) then overrides the query time range. Relevant only for rules of the kind LogAlert.
@@ -1170,13 +1177,6 @@ The flag which indicates whether the provided query should be validated or not.
11701177
- Type: bool
11711178
- Default: `False`
11721179

1173-
### Parameter: `suppressForMinutes`
1174-
1175-
Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. If set, autoMitigate must be disabled. Relevant only for rules of the kind LogAlert.
1176-
1177-
- Required: No
1178-
- Type: string
1179-
11801180
### Parameter: `tags`
11811181

11821182
Tags of the resource.

avm/res/insights/scheduled-query-rule/main.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ param actions actionsType?
7272
param criterias resourceInput<'Microsoft.Insights/scheduledQueryRules@2025-01-01-preview'>.properties.criteria
7373

7474
@description('Optional. Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. If set, autoMitigate must be disabled. Relevant only for rules of the kind LogAlert.')
75-
param suppressForMinutes string?
75+
param muteActionsDuration string?
7676

7777
@description('Optional. Tags of the resource.')
7878
param tags resourceInput<'Microsoft.Insights/scheduledQueryRules@2025-01-01-preview'>.tags?
@@ -174,7 +174,7 @@ resource queryRule 'Microsoft.Insights/scheduledQueryRules@2025-01-01-preview' =
174174
...(empty(ruleResolveConfiguration)
175175
? {
176176
autoMitigate: autoMitigate
177-
muteActionsDuration: suppressForMinutes
177+
muteActionsDuration: muteActionsDuration
178178
}
179179
: {})
180180
}

avm/res/insights/scheduled-query-rule/main.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"metadata": {
66
"_generator": {
77
"name": "bicep",
8-
"version": "0.37.4.10188",
9-
"templateHash": "2960992235052760601"
8+
"version": "0.39.26.7824",
9+
"templateHash": "11117582948611480157"
1010
},
1111
"name": "Scheduled Query Rules",
1212
"description": "This module deploys a Scheduled Query Rule."
@@ -357,7 +357,7 @@
357357
"description": "Required. The rule criteria that defines the conditions of the scheduled query rule."
358358
}
359359
},
360-
"suppressForMinutes": {
360+
"muteActionsDuration": {
361361
"type": "string",
362362
"nullable": true,
363363
"metadata": {
@@ -436,7 +436,7 @@
436436
"tags": "[parameters('tags')]",
437437
"identity": "[variables('identity')]",
438438
"kind": "[parameters('kind')]",
439-
"properties": "[shallowMerge(createArray(createObject('actions', createObject('actionGroups', tryGet(parameters('actions'), 'actionGroupResourceIds'), 'actionProperties', coalesce(tryGet(parameters('actions'), 'actionProperties'), createObject()), 'customProperties', coalesce(tryGet(parameters('actions'), 'customProperties'), createObject())), 'criteria', parameters('criterias'), 'description', parameters('alertDescription'), 'displayName', coalesce(parameters('alertDisplayName'), parameters('name')), 'enabled', parameters('enabled'), 'scopes', parameters('scopes')), if(equals(parameters('kind'), 'LogAlert'), shallowMerge(createArray(createObject('evaluationFrequency', parameters('evaluationFrequency'), 'overrideQueryTimeRange', parameters('queryTimeRange'), 'severity', parameters('severity'), 'skipQueryValidation', parameters('skipQueryValidation'), 'targetResourceTypes', parameters('targetResourceTypes'), 'windowSize', parameters('windowSize'), 'resolveConfiguration', parameters('ruleResolveConfiguration')), if(empty(parameters('ruleResolveConfiguration')), createObject('autoMitigate', parameters('autoMitigate'), 'muteActionsDuration', parameters('suppressForMinutes')), createObject()))), createObject())))]"
439+
"properties": "[shallowMerge(createArray(createObject('actions', createObject('actionGroups', tryGet(parameters('actions'), 'actionGroupResourceIds'), 'actionProperties', coalesce(tryGet(parameters('actions'), 'actionProperties'), createObject()), 'customProperties', coalesce(tryGet(parameters('actions'), 'customProperties'), createObject())), 'criteria', parameters('criterias'), 'description', parameters('alertDescription'), 'displayName', coalesce(parameters('alertDisplayName'), parameters('name')), 'enabled', parameters('enabled'), 'scopes', parameters('scopes')), if(equals(parameters('kind'), 'LogAlert'), shallowMerge(createArray(createObject('evaluationFrequency', parameters('evaluationFrequency'), 'overrideQueryTimeRange', parameters('queryTimeRange'), 'severity', parameters('severity'), 'skipQueryValidation', parameters('skipQueryValidation'), 'targetResourceTypes', parameters('targetResourceTypes'), 'windowSize', parameters('windowSize'), 'resolveConfiguration', parameters('ruleResolveConfiguration')), if(empty(parameters('ruleResolveConfiguration')), createObject('autoMitigate', parameters('autoMitigate'), 'muteActionsDuration', parameters('muteActionsDuration')), createObject()))), createObject())))]"
440440
},
441441
"queryRule_lock": {
442442
"condition": "[and(not(empty(coalesce(parameters('lock'), createObject()))), not(equals(tryGet(parameters('lock'), 'kind'), 'None')))]",

avm/res/insights/scheduled-query-rule/tests/e2e/defaults/dependencies.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ param location string = resourceGroup().location
44
@description('Required. The name of the Log Analytics Workspace to create.')
55
param logAnalyticsWorkspaceName string
66

7-
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
7+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2025-07-01' = {
88
name: logAnalyticsWorkspaceName
99
location: location
1010
}

avm/res/insights/scheduled-query-rule/tests/e2e/defaults/main.test.bicep

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ param namePrefix string = '#_namePrefix_#'
2626

2727
// General resources
2828
// =================
29-
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
29+
resource resourceGroup 'Microsoft.Resources/resourceGroups@2025-04-01' = {
3030
name: resourceGroupName
3131
location: resourceLocation
3232
}
@@ -36,7 +36,6 @@ module nestedDependencies 'dependencies.bicep' = {
3636
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
3737
params: {
3838
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
39-
location: resourceLocation
4039
}
4140
}
4241

avm/res/insights/scheduled-query-rule/tests/e2e/max/dependencies.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ param logAnalyticsWorkspaceName string
1010
@description('Required. The name of the Action Group to create.')
1111
param actionGroupName string
1212

13-
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
13+
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30' = {
1414
name: managedIdentityName
1515
location: location
1616
}
1717

18-
module logAnalyticsWorkspace 'br/public:avm/res/operational-insights/workspace:0.11.1' = {
18+
module logAnalyticsWorkspace 'br/public:avm/res/operational-insights/workspace:0.14.2' = {
1919
params: {
2020
name: logAnalyticsWorkspaceName
2121
roleAssignments: [

avm/res/insights/scheduled-query-rule/tests/e2e/max/main.test.bicep

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var enforcedLocation = 'germanywestcentral'
2727

2828
// General resources
2929
// =================
30-
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
30+
resource resourceGroup 'Microsoft.Resources/resourceGroups@2025-04-01' = {
3131
name: resourceGroupName
3232
location: enforcedLocation
3333
}
@@ -39,7 +39,6 @@ module nestedDependencies 'dependencies.bicep' = {
3939
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
4040
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}1'
4141
actionGroupName: 'dep-${namePrefix}-ag-${serviceShort}'
42-
location: enforcedLocation
4342
}
4443
}
4544

@@ -135,7 +134,7 @@ module testDeployment '../../../main.bicep' = [
135134
scopes: [
136135
nestedDependencies.outputs.logAnalyticsWorkspaceResourceId
137136
]
138-
suppressForMinutes: 'PT5M'
137+
muteActionsDuration: 'PT5M'
139138
windowSize: 'PT5M'
140139
tags: {
141140
'hidden-title': 'This is visible in the resource name'

avm/res/insights/scheduled-query-rule/tests/e2e/waf-aligned/dependencies.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ param location string = resourceGroup().location
44
@description('Required. The name of the Log Analytics Workspace to create.')
55
param logAnalyticsWorkspaceName string
66

7-
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
7+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2025-07-01' = {
88
name: logAnalyticsWorkspaceName
99
location: location
1010
}

avm/res/insights/scheduled-query-rule/tests/e2e/waf-aligned/main.test.bicep

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ param namePrefix string = '#_namePrefix_#'
2626

2727
// General resources
2828
// =================
29-
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
29+
resource resourceGroup 'Microsoft.Resources/resourceGroups@2025-04-01' = {
3030
name: resourceGroupName
3131
location: resourceLocation
3232
}
@@ -36,7 +36,6 @@ module nestedDependencies 'dependencies.bicep' = {
3636
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
3737
params: {
3838
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
39-
location: resourceLocation
4039
}
4140
}
4241

@@ -85,7 +84,7 @@ module testDeployment '../../../main.bicep' = [
8584
scopes: [
8685
nestedDependencies.outputs.logAnalyticsWorkspaceResourceId
8786
]
88-
suppressForMinutes: 'PT5M'
87+
muteActionsDuration: 'PT5M'
8988
windowSize: 'PT5M'
9089
tags: {
9190
'hidden-title': 'This is visible in the resource name'

0 commit comments

Comments
 (0)