Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for specifying custom Azure deployment tags in azure.yaml and wires them through project loading into Bicep provisioning so they’re merged with built-in azd deployment tags (built-ins win).
Changes:
- Added
tags:toazure.yamlschema +ProjectConfigand parsing tests. - Propagated project-level tags into infra provisioning options during
Load(). - Merged custom tags into ARM deployment tags in the Bicep provider (without overriding built-in azd tags).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/v1.0/azure.yaml.json | Adds a top-level tags property for custom deployment tags. |
| cli/azd/pkg/project/project_config.go | Adds ProjectConfig.Tags field for YAML parsing. |
| cli/azd/pkg/project/project.go | Copies project-level tags into infra options during Load(). |
| cli/azd/pkg/infra/provisioning/provider.go | Adds Options.Tags for passing custom tags through provisioning. |
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go | Merges user tags into deployment tags while preserving built-in precedence. |
| cli/azd/pkg/project/project_config_test.go | Adds table-driven tests for parsing tags from YAML. |
| cli/azd/pkg/project/project_test.go | Adds a load test asserting tags propagate into infra options. |
Add a `tags:` section to azure.yaml that allows users to specify custom Azure resource tags. Tags are merged with the default azd-env-name tag and passed to Bicep provisioning. Fixes #4479 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6550976 to
f8d6ac3
Compare
spboyer
left a comment
There was a problem hiding this comment.
All 3 review comments addressed:
- ✅ Tags propagated to layers — Added loop in
Load()that copies project-level tags into each layer'sTags, respecting layer-level overrides. - ✅ Tag merge precedence test — Added
TestDeploymentTagMergePrecedenceverifying custom tags are included but built-inazd-env-nameis never overridden. - ✅ Layered provisioning test — Added
TestLoadProjectTagsPropagateToLayerswithinfra.layersconfig asserting tags propagate to each layer.
Please resolve the threads.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
Fixes #4479
Adds a
tags:section toazure.yamlallowing users to specify custom Azure resource tags without modifying Bicep templates.Changes
project_config.go— AddedTags map[string]stringfield toProjectConfigprovider.go— AddedTagsfield to provisioningOptionsproject.go— Propagates project-level tags intoInfra.TagsduringLoad()bicep_provider.go— Merges custom tags into deployment tags (built-in azd tags take precedence)azure.yaml.json— Schema updated withtagspropertyUsage
Built-in azd tags (
azd-env-name,azd-layer-name,azd-provision-param-hash) always take precedence over user-specified tags.