Skip to content

Add optional outbound VNet integration and caller IP filter policies in Bicep - #34

Merged
Paul Yuknewicz (paulyuk) merged 1 commit into
mainfrom
feat/bicep-optional-networking
Nov 2, 2026
Merged

Paul Yuknewicz (paulyuk) merged 1 commit into
mainfrom
feat/bicep-optional-networking

Conversation

@paulyuk

Copy link
Copy Markdown
Member

Problem

Operators deploying standalone Microsoft.ApiManagement/aigateways resources often need to attach the gateway to a delegated VNet subnet for outbound private backend routing (properties.backend.subnet.id) or restrict inbound caller CIDR ranges via inline ipFilter policies without editing the Bicep templates directly.

Solution

  • Adds optional backendSubnetResourceId (string = '') to infra/main.bicep and infra/ai-gateway/main.bicep, wiring properties.backend.subnet.id when supplied (subnet must be in the same subscription and region and delegated to Microsoft.App/environments).
  • Adds optional allowedCallerCidrRanges (array = []) to infra/main.bicep and infra/ai-gateway/main.bicep, appending an inline { type: 'ipFilter', action: 'Allow', cidrRanges: allowedCallerCidrRanges } policy to registered models and the declarative toolServers/github MCP server when non-empty.
  • Adds contract assertions in tests/test-ai-gateway-model-registration.sh and documents both parameters in infra/README.md and infra/ai-gateway/README.md.

Canonical DX

az deployment group create \
  --resource-group rg-ai-gateway \
  --template-file ./infra/ai-gateway/main.bicep \
  --parameters location=eastus2 \
               gatewayName=aigw-example \
               backendSubnetResourceId="/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Network/virtualNetworks/<vnet>/subnets/<delegated-subnet>" \
               allowedCallerCidrRanges='["10.0.0.0/8","192.168.1.0/24"]'

…icep

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4448b1aa-1ea5-4c5f-af63-7ec98b7acb9e
@paulyuk
Paul Yuknewicz (paulyuk) merged commit 375ab3d into main Nov 2, 2026
2 checks passed
@paulyuk
Paul Yuknewicz (paulyuk) deleted the feat/bicep-optional-networking branch November 2, 2026 15:28
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