Skip to content

Migrate AI Gateway ARM contracts to 2026-11-01 - #39

Open
Paul Yuknewicz (paulyuk) wants to merge 2 commits into
mainfrom
paulyuk/api-2026-11-01
Open

Paul Yuknewicz (paulyuk) wants to merge 2 commits into
mainfrom
paulyuk/api-2026-11-01

Conversation

@paulyuk

@paulyuk Paul Yuknewicz (paulyuk) commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Overview

Operators provisioning or redeploying this sample need Microsoft.ApiManagement/aigateways templates and azd hooks that target the generally available 2026-11-01 ARM contract deployed across Azure regions rather than the 2025-09-01-preview schema.

This pull request updates all Microsoft.ApiManagement/aigateways Bicep resources, soft-delete lifecycle hooks, and postprovision configuration scripts to 2026-11-01 while retaining the 2025-09-01-preview check only where the postprovision script detects and rejects legacy Microsoft.ApiManagement/service gateways.

What changes

  • Bicep resources (infra/ai-gateway/main.bicep, infra/main.bicep):
    • Upgrades aigateways, workspaces, modelProviders, models, aliases, toolServers, telemetryExporters, and apiKeys (including listSecrets) to @2026-11-01.
    • Updates modelProviders/foundry to modelProviderType: 'Foundry', foundry.endpoint.url, and top-level authentication.managedIdentity.
    • Removes apiFormat from modelProviders/models entries.
    • Updates toolServers/github to toolServerType: 'mcp', blockList, endpoint mode: 'failClosed', mcp.endpoint.url, and authentication.headers.
    • Temporarily comments out/disables default AI Gateway contentSafety policy wiring on catalog models and toolServers/github pending upstream 2026-11-01 Content Safety API alignment, while preserving tokenLimit, costLimit, and optional ipFilter policies.
  • Lifecycle and postprovision scripts (infra/scripts/manage-ai-gateway-lifecycle.{sh,ps1}, infra/scripts/configure-ai-gateway.{sh,ps1}):
    • Switches AI_GATEWAY_API_VERSION to 2026-11-01 for soft-delete recovery/purge, provider checks, OpenTelemetry exporter configuration (telemetryExporterType: 'OpenTelemetry', openTelemetry.*Endpoint.url, top-level authentication.managedIdentity), and authenticated GitHub MCP tool server registration (with policies: [] while contentSafety is disabled).
  • Documentation and contract checks (README.md, infra/README.md, infra/ai-gateway/README.md, IMPLEMENTATION_NOTES.md, tests/):
    • Aligns Bicep template assertions, lifecycle script checks, and documentation with the 2026-11-01 wire schema and temporarily disabled gateway contentSafety policy.

Canonical usage

Provision the full stack with Azure Developer CLI as before:

azd auth login
azd env new my-aigateway-env
azd up

To validate or deploy the standalone AI Gateway Bicep module directly against 2026-11-01:

az bicep build --file infra/ai-gateway/main.bicep
az deployment group what-if \
  --resource-group <resource-group> \
  --template-file infra/ai-gateway/main.bicep \
  --parameters gatewayName=<gateway-name> foundryEndpoint=https://<foundry-account>.cognitiveservices.azure.com/

Representative 2026-11-01 Foundry provider contract in Bicep:

resource foundryProvider 'Microsoft.ApiManagement/aigateways/workspaces/modelProviders@2026-11-01' = {
  parent: defaultWorkspace
  name: 'foundry'
  properties: {
    displayName: 'Microsoft Foundry'
    modelProviderType: 'Foundry'
    foundry: {
      endpoint: {
        url: foundryEndpoint
      }
      resourceIds: foundryResourceIds
    }
    authentication: {
      managedIdentity: {
        resource: 'https://cognitiveservices.azure.com/'
      }
    }
  }
}

Validation

  • Built Bicep entrypoints (infra/main.bicep, infra/ai-gateway/main.bicep) with az bicep build.
  • Verified compiled ARM contracts, policy wiring, listSecrets expressions, and Bash/PowerShell lifecycle and postprovision scripts via tests/test-ai-gateway-model-registration.sh, tests/test-apim-lifecycle.sh, and the Python unit test suite.
  • Verified the 2026-11-01 wire schemas for aigateways, modelProviders, models, aliases, toolServers, telemetryExporters, and apiKeys against live Azure ARM responses.

Switch Microsoft.ApiManagement/aigateways Bicep resources, lifecycle
purge hooks, and postprovision telemetry/MCP configuration from
2025-09-01-preview to the 2026-11-01 ARM contract, aligning Foundry
provider, model, MCP toolServer, and OpenTelemetry exporter schemas.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4448b1aa-1ea5-4c5f-af63-7ec98b7acb9e
Comment out default AI Gateway contentSafety policy wiring on catalog
models and omit it from the GitHub MCP tool server pending upstream
2026-11-01 Content Safety API alignment. Update module documentation and
contract tests accordingly.

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