Hello @Mark Pearson ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
Thank you for sharing the detailed scenario and the observations across both portal and SDK-based agent creation flows.
AI Foundry Agent Service supports private networking scenarios when the environment is configured according to the documented networking requirements and all required dependencies are accessible through the configured private network path.
The observed error HTTP 502 – upstream_dependency_failed generally indicates that:
- The request successfully reached Azure AI Foundry.
- Azure AI Foundry attempted to communicate with a required backend dependency.
- That dependency communication failed due to connectivity, DNS, networking, authorization, or configuration issues.
Regarding the portal vs SDK behavior
Azure portal operations typically invokes Azure service backend operations rather than performing all actions directly from the browser or VM.
The important point is:
- The portal flow and SDK flow both ultimately depend on Azure AI Foundry backend services.
- The success of agent creation depends on whether AI Foundry can successfully complete required backend operations and communicate with required dependencies.
Since both portal and SDK-based creation are failing, this suggests the issue is more likely related to a shared backend dependency, networking configuration, DNS resolution or permissions issue rather than the location from which the portal is accessed.
Regarding manual / SDK-Based agent creation :
Creating agents manually through the SDK/API is expected to work in a correctly configured Azure AI Foundry private networking deployment.
The SDK failure does not indicate that SDK-based creation is unsupported.
The current behavior suggests:
- The request is reaching Azure AI Foundry.
- Authentication is working sufficiently for the request to be processed.
- The failure occurs during downstream processing when Azure AI Foundry attempts to use required resources or dependencies.
Therefore, the focus should be on validating:
- Dependency connectivity
- Private Endpoint configuration
- DNS resolution
- Network routing
- Managed Identity permissions
- RBAC assignments
Please note that there are multiple networking layers involved.
A successful Private Endpoint connection to the Azure AI Foundry resource/project does not automatically guarantee that all Agent Service dependencies are reachable.
The following should be considered separately:
Azure AI Foundry Private Connectivity overs connectivity to the Foundry resource/project.
Agent service dependency connectivity covers access to dependent services such as:
- Azure Storage
- Azure Cosmos DB
- Azure AI Search
- Azure OpenAI (where applicable)
A Foundry Private Endpoint can be healthy while agent creation still fails because a required dependency cannot be reached.
The error 502 upstream_dependency_failed usually indicates a failure communicating with a downstream dependency.
In private networking environments, common causes include:
- Private Endpoint configuration issues
- Incorrect Private DNS configuration
- Storage connectivity failures
- Cosmos DB connectivity failures
- Azure AI Search connectivity failures
- Firewall or routing restrictions
- Managed Identity permissions
- RBAC authorization failures
Please check if the following validation checks help-
- Confirming supported deployment configuration Please confirm:
- Azure AI Foundry Agent Service is being used with a supported private networking configuration
- The project/resource configuration follows the documented private networking requirements
- Required dependencies are correctly associated with the environment
- Validating Backend Dependencies Please verify that all required dependencies:
- Exist
- Are correctly configured
- Are reachable through private networking
Typical dependencies include:
- Azure Storage
- Azure Cosmos DB
- Azure AI Search
- Azure OpenAI (if used)
These dependencies are required in standard setups where customer-managed resources are used for storing agent data.
- Validating private endpoint configuration For each required dependency, please verify if:
- Private Endpoint exists
- Connection state is Approved/Connected
- Endpoint is deployed into the correct VNet/subnet
- Network policies and routing allow connectivity
Validate Private Endpoints for:
- Azure AI Foundry
- Azure Storage
- Azure Cosmos DB
- Azure AI Search
- Azure OpenAI (where applicable)
Please note that private endpoints for dependencies are not automatically created and must be configured separately.
- Validating DNS resolution Private Endpoint scenarios depend heavily on correct DNS configuration. From a VM inside the spoke VNet, run:
nslookup <resource-fqdn>
Please validate that:
- Storage resolves to a private IP
- Cosmos DB resolves to a private IP
- AI Search resolves to a private IP
- Other dependent resources resolve correctly
Incorrect DNS resolution can prevent access to private endpoints even when they are correctly configured.
- Validating Cosmos DB connectivity Cosmos DB should be treated as a high-priority validation item. Verify:
- Cosmos DB Private Endpoint exists
- DNS resolves correctly
- Connectivity from the environment is successful
- Required permissions are assigned
Connectivity issues with Cosmos DB can directly impact agent creation operations.
- Validating storage and search connectivity Azure Storage
- Private Endpoint connectivity
- DNS resolution
- Required permissions
Azure AI Search
- Private Endpoint connectivity
- DNS resolution
- Authentication/authorization configuration These resources are required in standard deployments for storing files, threads, and vector data.
- Validating managed identity and RBAC Although the error pattern suggests connectivity issues, authorization failures can also appear as dependency failures. Please verify:
- Required managed identities are enabled
- Azure AI Foundry/Agent Service identities have required permissions
- RBAC assignments exist for:
- Storage
- Cosmos DB
- Azure AI Search
- Validating Firewall, NSG and Routing Please review whether the environment uses:
- Azure Firewall
- Network Security Groups
- User Defined Routes
- Third-party firewall appliances
To confirm:
- Required traffic is allowed
- Routing is not redirecting traffic incorrectly
- TLS inspection is not interfering with Azure service communication
- No outbound dependency access is blocked
As an optional diagnostic test
If permitted by security policy, perform a controlled diagnostic test:
- Temporarily allow public network access or relax private networking restrictions
- Retry agent creation
If the operation succeeds, this strongly indicates that the issue is related to:
- Private Endpoint configuration
- DNS
- Routing
- Firewall rules
- Network reachability
For further assistance and to narrow down the exact dependency causing the failure, please let us know:
- If this is using Standard Agent setup with private networking?
- The dependencies which are configured?
- Storage
- Cosmos DB
- AI Search
- Azure OpenAI
- Are private endpoints configured for each dependency?
- Are private DNS zones linked to the spoke VNet?
- Is Azure Firewall or custom DNS involved?
- Was private networking configured during initial deployment or added afterwards?
- Does a minimal agent creation attempt also fail?
The following references might be helpful , please check them out
Please let us know if the response was helpful
Thank you