Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: actions implementation in scheduledQueryRule module #3843

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions avm/res/insights/scheduled-query-rule/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ param tags object?
@sys.description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var actionGroups = [
for action in actions: {
actionGroupId: action.?actionGroupId ?? action
webHookProperties: action.?webHookProperties
}
]

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
Expand Down Expand Up @@ -126,10 +133,7 @@ resource queryRule 'Microsoft.Insights/scheduledQueryRules@2023-03-15-preview' =
tags: tags
kind: kind
properties: {
actions: {
actionGroups: actions
customProperties: {}
}
actions: actionGroups
autoMitigate: (kind == 'LogAlert') ? autoMitigate : null
criteria: criterias
description: alertDescription
Expand Down