Anonymous resources
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
# Anonymous resources
## Current Syntax
```
resource dnsZone 'Microsoft.Network/dnszones@2018-05-01': {
name: 'myZone'
location: 'global'
}
```
## Proposal
Most resources in a template do not need to be referenced. Why does the user need to provide a 2nd name (in addition to the `name` property) that serves no purpose?
This could look like the following:
```
resource 'Microsoft.Network/dnszones@2018-05-01': {
name: 'myZone'
location: 'global'
}
```
## Considerations
1. Compiled template will deploy an anonymous resource like any other.
1. We could use a discard syntax like in C# but that would force users to type `_` every time. Seems annoying as well.
1. Do we show resource declarations without identifiers in [Show All Symbol Definitions](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-all-symbol-definitions-within-a-document) in VS code? I think we should because they will be an interesting navigation point, but will need to make up a name somehow.
Contributor guide
Research direction
Start by reviewing the current resource declaration syntax and the proposed anonymous-resource examples. Check how compiled templates and VS Code's Show All Symbol Definitions should handle declarations without identifiers; done means the syntax, deployment behavior, and navigation treatment are agreed and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100