fix: reduce S0 AccountCount MinCapacity from 2 to 1#8571
Conversation
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>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the implicit AI quota pre-check for location selection so that free-tier subscriptions (where OpenAI.S0.AccountCount commonly has a limit of 1) are no longer incorrectly rejected.
Changes:
- Reduce the implicit
OpenAI.S0.AccountCountquota requirement fromMinCapacity: 2toMinCapacity: 1when filtering locations. - Update inline documentation/comments to reflect the new minimum.
| // 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}, | ||
| } |
JeffreyCA
left a comment
There was a problem hiding this comment.
Confirmed this fixes the issue on a personal free trial subscription, but I had to remove the gpt-realtime-mini model deployment as I actually had 0 quota for it
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Problem
After the fix in #8537 for empty
/usagesresponses, free-tier Azure subscriptions still fail the AI quota pre-check (issue #8563). TheOpenAI.S0.AccountCountquota hasLimit=1on free subscriptions, but the code requiresMinCapacity: 2, rejecting every location.Root Cause
PR #4929 changed the S0 account quota check from
remaining >= 1toremaining >= 2with the comment "The minimum quota for the S0 SKU in Microsoft.CognitiveServices/accounts is 2 capacity units." However:OpenAI.S0.AccountCountcounts distinct resource instances; creating one S0 account consumes exactly 1 unit.Limit=1— soremaining(1) < MinCapacity(2)always fails.>= 2is trivially satisfied.Fix
Change
MinCapacityfrom2to1inprompt.gofor the implicitOpenAI.S0.AccountCountrequirement.Fixes #8563