Azure / Azure/bicep

Super unintelligible error message when assigning an empty object `identity` property

Open
#8,238 0 comments 0 reactions 0 assignees View on GitHub
error-message
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
`0.9.1`

**Describe the bug**
Deploying or validating a template with identity set to `{}` yields an error message with no context - I had to use process of elimination to track it down.

**To Reproduce**
* Bicep
```bicep
resource website 'Microsoft.Web/sites@2022-03-01' = {
name: 'foo'
location: resourceGroup().location
properties: {}
identity: {}
}
```
* Bash
```sh
az deployment group validate --template-file main.bicep --resource-group ant-test
```

The error message that is returned:
```json
{"code": "InvalidTemplate", "message": "Deployment template parse failed: 'Required property 'type' not found in JSON. Path ''.'."}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the Bicep template and the az deployment group validate command shown in the report. Trace how an empty identity object is validated and improve the resulting error so it identifies the relevant resource or property and provides actionable context.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.