Azure / Azure/bicep

Microsoft.Insights/activityLogAlerts: ActionGroupIdIsNull

Open
#11,616 6 comments 0 reactions 0 assignees View on GitHub
type system
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
0.20.4

**Describe the bug**
When I deploy the log alert I get this error:
```
The actionGroupId in the actionGroup is null.
```

**To Reproduce**
```
resource azureInfoEmail 'Microsoft.Insights/actionGroups@2023-01-01' = {
name: ''
location: 'Global'
properties: {
enabled: true
emailReceivers: [
{
name: 'Azure'
emailAddress: ''
}
]
}
}

// Alerts
resource serviceHealthEmail 'Microsoft.Insights/activityLogAlerts@2020-10-01' = {
name: 'Service Health - Email'
location: 'Global'
properties: {
enabled: true
scopes: [
subscription().id
]
actions: {
actionGroups: [
azureInfoEmail
]
}
condition: {
allOf: [
{
field: 'category'
equals: 'ServiceHealth'
}
]
}
}
}
```

**Additional context**
I tried to create the alert through Azure Portal first, it didn't work but this is the what-if:
```
~ properties.actions.actionGroups: [
~ 0:

- actionGroupId: "/subscriptions//resourcegroups//providers/microsoft.insights/actiongroups/"
+ properties:

emailReceivers: [
0:

emailAddress: ""
name: "Azure Info"

]
enabled: true

]
```

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction Bicep template and compare its activityLogAlerts actionGroups value with the Azure Portal what-if output. Investigate how the referenced action group is represented during deployment; done means the alert deploys successfully without the actionGroupId being null.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.