Skip to content

Fix Bicep deployment lookup across projects - #9490

Draft
Victor Vazquez (vhvb1989) wants to merge 1 commit into
mainfrom
vhvb1989/fix-8701-project-deployment-tag
Draft

Fix Bicep deployment lookup across projects#9490
Victor Vazquez (vhvb1989) wants to merge 1 commit into
mainfrom
vhvb1989/fix-8701-project-deployment-tag

Conversation

@vhvb1989

Copy link
Copy Markdown
Member

Summary

  • tag standard Bicep ARM deployments with an azd-project-name identity resolved from azure.yaml.name or the project directory
  • prefer project-specific deployment history for refresh, down, and provision-state lookup while retaining a legacy fallback
  • force one real provision when only a legacy deployment exists, then preserve project/layer tags when down voids deployment state

Fixes #8701

Migration behavior

Existing deployments without azd-project-name continue to use the previous newest-deployment fallback. The first provision with this version cannot reuse a legacy deployment's cached state, so it writes a project-tagged deployment and future lookups become unambiguous. Each colliding project/environment must be provisioned once to complete migration.

Deployment stacks intentionally retain their existing identity behavior because changing stack names would create a second owner for resources managed by an existing stack.

Validation

  • go test ./pkg/infra/... ./pkg/azapi -count=1
  • go build ./...
  • focused configured-linter runs on changed packages
  • formatting, copyright, and spelling checks

Full mage preflight was not completed because golangci-lint 2.11.4 remains CPU-bound indefinitely when multiple package roots run together; the same linters pass when isolated by package/analyzer.

Tag standard ARM deployments with project identity and prefer project-specific deployment history while retaining a legacy fallback for existing environments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8f8fec20-564b-4f35-8720-6c8f88bc9f08
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Incorrect project being picked up by azd refresh and azd down

1 participant