Skip to content

Preflight quota check duplicates azd's own warning on the Bicep variant #23

@achandmsft

Description

@achandmsft

Follow-up to #21 / #22, reported by @pamelafox after the previous fix:

After softening the preflight, a fresh azd up on the Bicep variant with eastus2 quota exhausted produced two quota warnings — one from the preflight, one from azd itself:

(!) 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> or request a quota increase in the Azure portal.
  • Increase Azure subscription quotas

That second warning is azd's provisionParametersResolver doing its own ARM preflight on the Bicep template. It's clean, prints a usable suggestion, and prompts the customer to continue.

Why the preflight currently hard-fails on quota

The preflight's quota check (exit 6) exists primarily to protect the Terraform variant: azapi_resource bypasses ARM preflight, so the resource provider returns the opaque 400 715-123420 instead of a readable InsufficientQuota. The preflight catches that before it happens.

For Bicep, ARM preflight runs through azd, so the customer gets the clean message regardless. The preflight's hard fail just blocks azd's own (better) UX from ever showing.

Proposed fix

Detect the IaC variant by inspecting ./azure.yaml in the preflight's working directory (the hook always runs from the variant folder):

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

Marketplace-offer-not-found (exit 4) stays a hard fail in both variants — a typo / unreleased SKU is broken regardless of which provider you use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions