fix: add outbound PE rules for managed VNet hosted agent connectivity - #755
Open
karthiksaligrama wants to merge 2 commits into
Open
Conversation
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>
foundry-samples-repo-sync Bot
pushed a commit
that referenced
this pull request
Jul 22, 2026
#755) Distinguishes the 'dig works but getaddrinfo fails' pattern (intermittent EAI_AGAIN with clean raw/dig results and no firewall drops): - parallel_probe: replicate glibc's default getaddrinfo by sending A and AAAA back-to-back on ONE UDP socket; report both_ok_rate. Loss here while sequential per-record queries are clean = concurrent-query problem (PARALLEL_DUAL_LOSS), the cause of getaddrinfo failures dig cannot reproduce and firewalls show no ACL drops for. - gai_attempts: repeat getaddrinfo N times and report the failure rate (successes/failures + per-error counts) - the intermittent EAI_AGAIN the app actually experiences, distinct from the wire-level raw result. Both probes are wrapped in their own try/except so a failure in either can never abort the host's other checks or the overall response (still HTTP 200). New optional request fields (gai_attempts, parallel_probe) are backward compatible. README + contract updated. Co-authored-by: vtrika <vtrika@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
dependsOnto avoid API conflicting state errorsmanagedNetworkdepends onaiDependenciesmodule)location = 'eastus2', default toresourceGroup().locationTesting
Successfully deployed to a fresh resource group in swedencentral — all outbound rules provisioned sequentially, capability host created, full deployment succeeded.