`identity` is required on `Microsoft.OperationalInsights/clusters@2021-06-01` but bicep allows it to be missing
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
**Bicep version**
Bicep CLI version 0.4.1272 (a69022dd2c)
**Describe the bug**
I suspect this is an provider API definition bug, but with am not entirely sure if there's something special going on with the `identity` section as that's shared across multiple resources.
Bicep will compile a `Microsoft.OperationalInsights/clusters@2021-06-01` resource without providing an identity, but attempting to deploy such a resource fails with an error suggesting an identity is always required
```
{
"status": "Failed",
"error": {
"code": "BadRequest",
"message": "IdentityType: user should choose a single identity type - SystemAssigned/UserAssigned/None, what was actually provided - []"
}
}
```
**To Reproduce**
```bicep
resource cluster 'Microsoft.OperationalInsights/clusters@2021-06-01' = {
name: clusterName
location: location
sku:{
name: 'CapacityReservation'
capacity: capacity
}
properties: {
billingType: 'Workspaces'
isAvailabilityZonesEnabled: true
}
}
```
**Additional context**
The above template also passes a what-if deployment - I'm not sure if that has the same root cause of incorrect provider api definitions, or if it's a seperate issue.
Contributor guide
Research direction
Start by reproducing the minimal template with Bicep CLI 0.4.1272 and compare compilation, what-if, and deployment behavior. Then trace the provider API definition for Microsoft.OperationalInsights/clusters@2021-06-01 and the shared identity handling; the issue is done when missing identity is validated consistently with the deployment API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100