Skip to content

Preflight: warn-only on quota for the Bicep variant#24

Merged
achandmsft merged 1 commit into
mainfrom
fix/preflight-quota-warn-for-bicep
May 29, 2026
Merged

Preflight: warn-only on quota for the Bicep variant#24
achandmsft merged 1 commit into
mainfrom
fix/preflight-quota-warn-for-bicep

Conversation

@achandmsft
Copy link
Copy Markdown
Collaborator

Fixes #23. Follow-up to #21 / #22.

After the previous fix, deploying the Bicep variant with quota exhausted produced two near-identical quota warnings — one from the preflight script, one from azd's own provisionParametersResolver. Pamela hit this on eastus2 after #22:

(!) Warning: Insufficient quota for model "claude-sonnet-4-6" (SKU: GlobalStandard) in eastus2
  Requested: 25 · Available: -20
  Suggestion: No quota is available. Change your deployment location via azd env set AZURE_LOCATION <location> ...

That second message is azd doing its own ARM preflight and prompting the customer to continue. For Bicep, it's the source of truth. The preflight's hard fail just blocks that better UX.

What changes

Both preflight scripts now detect the IaC variant from ./azure.yaml:

Variant Quota check
provider: bicep warn + continue (exit 0) — azd's ARM preflight surfaces it next
provider: terraform unchanged — hard fail (exit 6) because azapi_resource swallows quota into the opaque 400 715-123420
can't determine (script run outside a variant folder) hard fail — safe default

The marketplace-offer check (exit 4) stays a hard fail in both variants.

Verification

Same CLAUDE_SONNET_CAPACITY=999 request against eastus2 (limit 80):

  • From infra-terraform/:
    ERROR: Insufficient quota for 'claude-sonnet-4-6' ... exit=6
    
  • From infra-bicep/:
    Preflight WARNING: Insufficient quota for 'claude-sonnet-4-6' ...
    (Continuing — azd's Bicep ARM preflight will repeat this and prompt to continue.)
    Preflight OK.
    exit=0
    

skills/claude-on-foundry/SKILL.md and both scripts' header comments are updated to describe the new behavior.

Bicep's azd provisionParametersResolver already runs ARM preflight and prints a clean InsufficientQuota with a continue-prompt. The script's hard fail was producing a duplicate diagnostic and blocking azd's better UX.

Detect provider from ./azure.yaml. Bicep => warn + continue (exit 0). Terraform => hard fail (exit 6) unchanged, because azapi_resource bypasses ARM preflight and the RP returns the opaque 400 715-123420 instead. Unknown variant (script run outside a variant folder) => hard fail, safe default. Reported by @pamelafox.
@achandmsft achandmsft merged commit f9e45ff into main May 29, 2026
5 checks passed
@achandmsft achandmsft deleted the fix/preflight-quota-warn-for-bicep branch May 29, 2026 20:12
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 quota check duplicates azd's own warning on the Bicep variant

1 participant