Skip to content

Preflight: warn instead of hard-fail when missing env vars / az login#22

Merged
achandmsft merged 1 commit into
mainfrom
fix/preflight-graceful-warnings
May 29, 2026
Merged

Preflight: warn instead of hard-fail when missing env vars / az login#22
achandmsft merged 1 commit into
mainfrom
fix/preflight-graceful-warnings

Conversation

@achandmsft
Copy link
Copy Markdown
Collaborator

Fixes #21.

azd up blocked on a clean machine because the preflight hard-failed before azd / Bicep could prompt for missing parameters, and required az login without saying so in the README. Reported by @pamelafox.

What changes

scripts/preflight-claude.ps1 and scripts/preflight-claude.sh now treat the four soft preconditions as warnings instead of hard fails:

Check Before After
CLAUDE_ORGANIZATION_NAME empty exit 1 warn, continue (azd prompts for the Bicep param)
AZURE_LOCATION empty exit 1 warn, exit 0 (azd prompts)
az not on PATH exit 2 warn, exit 0 (skip marketplace + quota validation)
az not signed in exit 2 warn, exit 0 (skip marketplace + quota validation)
Marketplace offer not found exit 4 unchanged — typos and unreleased SKUs must fail fast
Insufficient quota exit 6 unchanged — the whole reason the preflight exists (Terraform azapi swallows quota errors into opaque 715-123420)

README.md Prerequisites now calls out az login as a recommended step so the preflight can do its catalog + quota checks. skills/claude-on-foundry/SKILL.md PLAN section now describes the preflight as best-effort.

Verification

Local run with no env vars set:

Preflight: CLAUDE_ORGANIZATION_NAME is not set. azd will prompt for the 'claudeOrganizationName' Bicep parameter at provision time. ...
Preflight: AZURE_LOCATION is not set. azd will prompt at provision time. Skipping marketplace + quota validation ...
exit code: 0

Net effect: a brand-new user can git clone && cd infra-bicep && azd up, get prompted by azd for the values that are normally prompted for, and the deploy proceeds. Users who have set AZURE_LOCATION + run az login still get the full proactive catalog + quota validation.

…#21)

Reported by @pamelafox: `azd up` on a clean machine hit `ERROR: CLAUDE_ORGANIZATION_NAME is required` before azd / Bicep could prompt for the parameter, and hit `ERROR: Azure CLI not found` because `az login` wasn't called out as a prerequisite.

The four soft preconditions (CLAUDE_ORGANIZATION_NAME, AZURE_LOCATION, az on PATH, az signed in) now warn and exit 0 so azd can prompt / the RP can take over. Marketplace-offer-not-found (exit 4) and insufficient quota (exit 6) remain hard fails -- those are the cases Terraform azapi swallows into the opaque 715-123420.
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.

Preflight blocks zd up on a clean machine (no env vars set / no z login)

1 participant