Location property incorrectly marked as does not exist in the resource definition
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 81
Description
**Bicep version**
Bicep CLI version 0.10.61 (8f44805506)
**Describe the bug**
Adding Basic Publishing Credentials Policy to a web app - Separate resource statements with a parent property tying it the main webapp. The property "location" is flagged as not exist in resource definition but might still be valid. If the "location" property is not present on the sub resources, then the template fails when attempting a deployment stating the location property is missing.
**To Reproduce**
```bicep
resource webApp 'Microsoft.Web/sites@2022-03-01' = {
name: webAppName
location: location
blah blah blah
}
resource webappFTP 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2022-03-01' = {
parent: webApp
name: 'ftp'
location: location //Here is where it's identified as not defined (yellow squiggles) resources deploy properly if in place but if removed, the template fails.
properties: {
allow: true
}
}
resource webappSCM 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2022-03-01' = {
parent: webApp
name: 'scm'
location: location //Here is where it's identified as not defined (yellow squiggles) resources deploy properly if in place but if
properties: {
allow: true
}
}
```
Contributor guide
Research direction
Reproduce the warning and deployment behavior using the Bicep CLI 0.10.61 and the two child-resource examples in the issue. Trace how the resource definition validates the location property for Microsoft.Web/sites/basicPublishingCredentialsPolicies. Done means valid location usage is not flagged incorrectly and deployments still succeed when the property is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100