Azure / Azure/bicep

Allow for declaring default properties that will be added to all resources declared in a bicep file/project

Open
#1,639 2 comments 0 reactions 0 assignees View on GitHub
enhancement
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.**
A common issue is needing to assign tags and location to multiple resources (and resources in submodules) that results in a lot of boilerplate code and potential mistakes (especially with tags) if it is forgotten on one or more resources. Nearly every resource has this tag/location definition and leads to a lot of cut/paste non-DRY that the README states is the goal of bicep to reduce.

**Describe the solution you'd like**
1. A `location` bicep keyword (similar to `module`) that will apply to all resources where location is relevant so it can be omitted. Potentially a `schema` keyword that if defined as `resourceGroup` the location would automatically be implicit as `resourcegroup().location`. If location is defined on a resource it overrides the default location setting.
1. A `tags` keyword that can be defined at any level and will flow to resources in the same file and downstream modules where tags can be defined and will be merged with any downlevel tags definitions. Potential Issue: How to override tags at a resource level if you want to explicitly override rather than merge. Special tag name perhaps? e.g. `__BICEP_DO_NOT_INHERIT: true`

EDIT: This is partially covered in a downstream conversation for https://github.com/Azure/bicep/issues/1121

Contributor guide

Open the contributing guide

Research direction

Start by reading the README and the downstream conversation in issue 1121, which the report identifies as related work. Define how file- and project-level location and tags apply to resources and downstream modules, including resource-level overrides and tag merging; done means the behavior and inheritance rules are specified consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.