Skip to content

Dynamic Region Filtering Based on User-Specified Model and Capacity on azd Quota check #5432

@Roopan-Microsoft

Description

@Roopan-Microsoft

Output from azd version
Latest

Describe the bug
Currently, region filtering in the template is based on hardcoded metadata values for the model and capacity. However, in our templates, we allow users to override these values using the azd env set command. When users do this, the hardcoded metadata becomes inaccurate, and the filtering no longer reflects their selected model or required capacity.

// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
@metadata({
azd : {
type: 'location'
usageName : [
'OpenAI.GlobalStandard.gpt-4o, 150'
]
}
})
@Allowed(['australiaeast', 'eastus2', 'francecentral', 'japaneast', 'norwayeast', 'swedencentral', 'uksouth', 'westus'])
@description('Azure OpenAI Location')
param aiDeploymentsLocation string

To Reproduce

  1. Use a template (Eg: https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator) with metadata that filters regions based on a hardcoded model and capacity.
  2. Override the model and capacity values using azd env set.
  3. Observe that the region filtering logic still uses the original hardcoded values and doesn't reflect the updated user-specified inputs.

Expected behavior
The region filtering logic should dynamically reflect the user's input provided through azd env set — specifically, the selected model and required capacity — instead of relying on static metadata values.

Environment
Information on your environment:
* Bicep
* IDE - VS Code / Codespaces

Additional context
Looking for guidance on how to implement dynamic region filtering that respects the user's overridden values. Ideally, we want to ensure the filtering logic remains consistent with the user's selected model and capacity at deployment time.

It’s also important to let users choose an Azure location of their choice during deployments. Many customers have strict compliance or governance rules that limit which regions they can use. Allowing this to be configured as a parameter would greatly improve flexibility and usability.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions