Skip to content

Omit default AI Gateway SKU in Bicep and lifecycle scripts - #36

Open
Paul Yuknewicz (paulyuk) wants to merge 1 commit into
mainfrom
fix/omit-default-aigateway-sku
Open

Paul Yuknewicz (paulyuk) wants to merge 1 commit into
mainfrom
fix/omit-default-aigateway-sku

Conversation

@paulyuk

Copy link
Copy Markdown
Member

Problem

The Microsoft.ApiManagement/aigateways resource provider now enforces sku.name = "Standard" and defaults to "Standard" when sku is omitted. Hardcoding sku: { name: 'Premium' } in infra/ai-gateway/main.bicep and filtering for sku.name == 'Premium' in the preprovision/postdown lifecycle scripts causes azd provision to fail with InvalidSkuName: The supported AI Gateway SKU name is 'Standard'.

Solution

  • Omit sku on Microsoft.ApiManagement/aigateways: Removed sku: { name: 'Premium' } from infra/ai-gateway/main.bicep so the resource provider applies its default SKU (Standard).
  • Remove hardcoded Premium SKU filters in lifecycle scripts: Updated infra/scripts/manage-ai-gateway-lifecycle.sh and infra/scripts/manage-ai-gateway-lifecycle.ps1 to identify environment-owned Microsoft.ApiManagement/aigateways resources by resource type and azd-env-name tag without requiring sku.name == 'Premium'.
  • Update tests and docs: Updated tests/test-ai-gateway-model-registration.sh, tests/test-apim-lifecycle.sh, and module documentation.

Canonical DX

# Provision the AI Gateway + Foundry Hosted Agent environment
azd provision
resource aiGateway 'Microsoft.ApiManagement/aigateways@2025-09-01-preview' = if (deployApimGatewayViaBicep) {
  name: gatewayName
  location: gatewayLocation
  tags: tags
  identity: {
    type: 'SystemAssigned'
  }
  properties: empty(backendSubnetResourceId)
    ? {}
    : {
        backend: {
          subnet: {
            id: backendSubnetResourceId
          }
        }
      }
}

Validation

  • az bicep build --file infra/main.bicep
  • bash tests/test-ai-gateway-model-registration.sh
  • bash tests/test-apim-lifecycle.sh

- Omit sku from Microsoft.ApiManagement/aigateways in infra/ai-gateway/main.bicep so the resource provider applies its default SKU (Standard).
- Remove hardcoded Premium SKU filters from manage-ai-gateway-lifecycle.sh and manage-ai-gateway-lifecycle.ps1.
- Update model registration and lifecycle tests and documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4448b1aa-1ea5-4c5f-af63-7ec98b7acb9e
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.

1 participant