Skip to content

fix: add outbound PE rules for managed VNet hosted agent connectivity#755

Open
karthiksaligrama wants to merge 2 commits into
microsoft-foundry:mainfrom
karthiksaligrama:fix/18-managed-vnet-outbound-pe-rules
Open

fix: add outbound PE rules for managed VNet hosted agent connectivity#755
karthiksaligrama wants to merge 2 commits into
microsoft-foundry:mainfrom
karthiksaligrama:fix/18-managed-vnet-outbound-pe-rules

Conversation

@karthiksaligrama
Copy link
Copy Markdown
Member

Problem

Hosted agents running in the Microsoft-managed VNet could not connect to Foundry project resources (Storage, Cosmos DB, AI Search) because no outbound private endpoint rules were configured on the managed network.

The customer VNet private endpoints only help external clients access resources — they don't help agents running inside the Microsoft-managed network reach those same resources.

Changes

  • managed-network.bicep: Add outbound PE rules for Storage (blob), Cosmos DB (Sql), and AI Search (searchService) with sequential dependsOn to avoid API conflicting state errors
  • network-connection-approver-role.bicep (new): Reusable module for assigning Network Connection Approver role at any scope (needed for BYO resources in different RGs)
  • main.bicep: Pass resource IDs to managed network module, add conditional cross-RG role assignments, fix dependency chain (managedNetwork depends on aiDependencies module)
  • main.bicepparam: Remove hardcoded location = 'eastus2', default to resourceGroup().location

Testing

Successfully deployed to a fresh resource group in swedencentral — all outbound rules provisioned sequentially, capability host created, full deployment succeeded.

Karthik Saligrama and others added 2 commits June 5, 2026 05:23
Hosted agents running in Microsoft-managed VNet could not connect to
Foundry project resources (Storage, Cosmos DB, AI Search) because no
outbound private endpoint rules were configured on the managed network.

Changes:
- Add outbound PE rules for Storage (blob), Cosmos DB (Sql), and AI
  Search (searchService) in managed-network.bicep with sequential
  dependsOn to avoid API conflicting state errors
- Add network-connection-approver-role.bicep module for cross-RG role
  assignments when BYO resources are in different resource groups
- Update main.bicep to pass resource IDs to managed network module,
  add conditional cross-RG role assignments, and fix dependency chain
- Change location parameter to default to resourceGroup().location
  instead of hardcoding eastus2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hosted agents in the managed VNet also need a private endpoint back to
the Foundry/AI Services account itself, since publicNetworkAccess is
disabled. Without this, agents cannot reach the Foundry API.

Adds aiservices-account-rule as the first outbound PE rule in the
sequential chain (aiservices → storage → cosmos → search).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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