Improve compile-time validation of the resourceId() function for hard-coded resource types.
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Is your feature request related to a problem? Please describe.**
It's very easy to miss that the number of name segments that has to be provided to the `resourceId()` function has to match the number of type segments in the resource type. It's pretty easy to miss when refactoring existing code or decompiling a template. We ran into this with an internal Bicep file and this was the fix that was needed:

**Describe the solution you'd like**
In situations where the resource type is hard-coded, it would be great if we could enhance the validation to emit an error for an insufficient number of name segments.
Contributor guide
Research direction
Start at the compile-time validation entry point for resourceId() and inspect how hard-coded resource types and name segments are counted. Done means an insufficient number of name segments produces an error while valid counts continue to pass; add or run focused validation coverage if the repository provides it.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100