Skip to content

Wire TME test subscription through azd config to preflight pipeline #7777

@jongio

Description

@jongio

Problem

Functional/playback tests need Azure subscription, tenant, and location. Currently developers must manually set env vars (AZD_TEST_AZURE_SUBSCRIPTION_ID, etc.) each session. The non-CI fallback only covers subscription/location via defaults.*, not tenant, and conflates personal defaults with test config.

Proposal

Add defaults.test.* keys to azd config:

azd config set defaults.test.subscription 4d042dc6-fe17-4698-a23f-ec6a8d1e98f4
azd config set defaults.test.tenant 70a036f6-8e4d-4615-bad6-149c02e7720d
azd config set defaults.test.location eastus2

Changes needed

  1. cli/azd/test/functional/cli_test.go - Update cliConfig.init() resolution order: env vars -> defaults.test.* -> defaults.*
  2. cli/azd/magefile.go - Read defaults.test.* from azd config and pass as env vars to test subprocesses (unit + playback)
  3. azd-preflight skill - Document that azd config set defaults.test.* is the recommended one-time setup for local preflight with live test resources

Developer experience

One-time setup:

azd config set defaults.test.subscription 4d042dc6-...
azd config set defaults.test.tenant 70a036f6-...
azd config set defaults.test.location eastus2

Then mage preflight and the azd-preflight skill automatically pick up the TME subscription - no env vars, no .env files.

Metadata

Metadata

Assignees

Labels

engsysEngineering systemsenhancementNew feature or improvementtest automationTest infrastructure work

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions