From b7f31f31a5b75cbc5cc1f85959b9279875e786fd Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Tue, 9 Jun 2026 02:23:41 +0000 Subject: [PATCH] fix: reduce S0 AccountCount MinCapacity from 2 to 1 (#8563) The OpenAI.S0.AccountCount quota check required MinCapacity of 2, but creating one CognitiveServices/accounts resource consumes exactly 1 unit. Free-tier Azure subscriptions have an AccountCount limit of 1, so the previous threshold rejected every location even though the deployment only needs a single account. Change MinCapacity from 2 to 1 so free-tier subscriptions with remaining=1 pass the pre-check. Fixes #8563 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cli/azd/pkg/infra/provisioning/bicep/prompt.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/azd/pkg/infra/provisioning/bicep/prompt.go b/cli/azd/pkg/infra/provisioning/bicep/prompt.go index 5785c3e7545..3739db97369 100644 --- a/cli/azd/pkg/infra/provisioning/bicep/prompt.go +++ b/cli/azd/pkg/infra/provisioning/bicep/prompt.go @@ -82,16 +82,18 @@ func autoGenerate(parameter string, azdMetadata azure.AzdMetadata) (string, erro // locationsWithQuotaFor finds locations that have sufficient quota for the given usage requirements. // // The quotaFor parameter uses the Bicep metadata format: "UsageName" or "UsageName, Capacity". -// An implicit requirement for "OpenAI.S0.AccountCount" with capacity 2 is always included. +// An implicit requirement for "OpenAI.S0.AccountCount" with capacity 1 is always included. func (a *BicepProvider) locationsWithQuotaFor( ctx context.Context, subId string, locations []string, quotaFor []string) ([]string, error) { if a.aiModelService == nil { return nil, fmt.Errorf("AI model service is not configured") } - // Always require minimum S0 account quota + // Always require at least 1 remaining S0 account slot. + // Each CognitiveServices/accounts resource consumes exactly 1 unit of + // the OpenAI.S0.AccountCount quota regardless of subscription tier. requirements := []ai.QuotaRequirement{ - {UsageName: "OpenAI.S0.AccountCount", MinCapacity: 2}, + {UsageName: "OpenAI.S0.AccountCount", MinCapacity: 1}, } for _, definedUsageName := range quotaFor {