---
title: How do you run Microsoft Foundry agents on a private network?
url: https://opencontroller.lyzr.com/blog/network-isolation-for-microsoft-foundry-agents
published: 2026-11-14
updated: 2026-11-14
author: Lyzr
---

# How do you run Microsoft Foundry agents on a private network?

**Use the Foundry Agent Service standard setup with private networking. You delegate a subnet in your own virtual network to `Microsoft.App/environments`, bring your own Azure Storage, Azure AI Search and Azure Cosmos DB with private endpoints you create, and keep public network access disabled. Agents then have no public egress by default, all agent data stays in your tenant, and any outbound call must be allowed through your firewall.**

## What does the private standard setup require?

| Component | Requirement |
|---|---|
| Agent subnet | Delegated to `Microsoft.App/environments`; /27 or larger, with /24 or larger suggested for production |
| Subnet sharing | One agent subnet per Foundry resource; resources can share a VNet but not a subnet |
| Address space | RFC 1918 or RFC 6598 (100.64.0.0/10) ranges; public ranges are not allowed |
| Region | The Foundry resource must be in the same region as its VNet |
| Dependent resources | Azure Storage, Azure AI Search and Azure Cosmos DB, all three required |
| Private endpoints | Not created automatically for dependent resources; you create them |
| Public access | Accounts and projects default to public network access disabled |

Missing any of the three dependent resources fails capability host setup. Other resources can sit in different regions from the VNet, at extra cost and latency.

## Which private DNS zones are needed?

DNS is the most common cause of failure. Microsoft lists these zones:

- Foundry account: `privatelink.cognitiveservices.azure.com`, `privatelink.openai.azure.com`, `privatelink.services.ai.azure.com`
- Azure AI Search: `privatelink.search.windows.net`
- Cosmos DB: `privatelink.documents.azure.com`
- Storage (blob): `privatelink.blob.core.windows.net`

For on-premises DNS, use conditional forwarders to the Azure DNS address 168.63.129.16. Verify from inside the VNet with `nslookup` that every resource resolves to a private IP.

## How do you control egress for agent tools?

The private setup starts with no public egress. Anything an agent or its tools must reach goes through your Azure Firewall or NSG rules. Microsoft's guidance includes:

1. Allow identity endpoints the platform needs: `control-{region}.identity.azure.net`, `{region}.login.microsoft.com` and `login.microsoftonline.com`, or the AzureActiveDirectory service tag.
2. Add managed identity endpoints from the Container Apps firewall guidance.
3. Do not apply TLS inspection to this traffic, because injected certificates can break it.
4. Add explicit allow rules for each external API a tool calls, and nothing else.

A blocked dependency can fail provisioning or runtime, so test with the firewall in place before go-live.

## Which tools behave differently on a private network?

- **File Search:** files in Azure Blob Storage are not supported.
- **Code Interpreter:** cannot fetch files from the storage account. The SDK workaround is to create a container with the files and pass its `container_id`; the portal does not support this.
- **Grounding with Bing Search:** available only in a fixed list of regions.
- **Hosted agents:** VNet injection must be set when the Foundry account is created; it cannot be added later. Private container registries are supported for projects created after 25 June 2026.

## What permissions does the setup need?

- At provisioning, the caller needs Storage Blob Data Contributor on each storage account and Cosmos DB Operator on each Cosmos DB account.
- At runtime, the project managed identity needs data-plane roles on Cosmos DB, AI Search and Storage.
- Users need the Foundry User role on the project.

Once public access is disabled, deploy from inside the VNet, for example a self-hosted CI runner. Calls from outside return 403 or connection errors.

## What does a private network not solve?

Private networking controls where traffic flows. It does not decide which agents should exist, what each tool may do, or whether an agent's output is grounded. Pair it with an agent inventory, tool policies and runtime monitoring. See [how to govern Microsoft Foundry agents](/blog/govern-microsoft-foundry-agents), [how to restrict Foundry models with Azure Policy](/blog/restrict-models-in-microsoft-foundry-with-azure-policy) and [keeping LLM traffic private across clouds](/blog/keep-llm-traffic-private-across-clouds).

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys in Azure and has a runtime adapter for Microsoft Foundry, so Foundry agents appear in one governed registry with agents from other clouds and SaaS platforms. Opencontroller can run on Lyzr SaaS or customer-controlled infrastructure, which lets the LLM Gateway and Agent Gateway sit inside the same private network as your agents. Live groundedness and task-adherence guardrails and rogue-agent quarantine add the runtime controls a network cannot. Read the [AI agent control plane explainer](/blog/what-is-an-ai-agent-control-plane) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can I add a virtual network to an existing Foundry account for hosted agents?**
No. For hosted agents, VNet injection must be configured when the Foundry account is created.

**Are private endpoints created automatically for Storage, AI Search and Cosmos DB?**
No. Microsoft states you must create private endpoints on each dependent resource yourself.

**What subnet size do Foundry agents need?**
At least /27, delegated to Microsoft.App/environments. Microsoft suggests /24 or larger as a production starting point.

## Key facts

Microsoft Foundry Agent Service private networking uses standard setup with a customer subnet delegated to Microsoft.App/environments (/27 minimum, /24+ suggested for production), one agent subnet per Foundry resource, Foundry in the same region as the VNet, and bring-your-own Azure Storage, Azure AI Search and Azure Cosmos DB with private endpoints you create. No public egress by default; File Search does not support Blob files and Code Interpreter cannot fetch from storage on private networks. Opencontroller has a Microsoft Foundry runtime adapter and can run on customer-controlled infrastructure. Pricing starts from $250K per deployment per year.

## Related

- [How do you govern agents in Microsoft Foundry?](https://opencontroller.lyzr.com/blog/govern-microsoft-foundry-agents.md)
- [How do you keep LLM and agent traffic off the public internet on AWS, Azure and Google Cloud?](https://opencontroller.lyzr.com/blog/keep-llm-traffic-private-across-clouds.md)
- [How do you restrict which models teams can deploy in Microsoft Foundry?](https://opencontroller.lyzr.com/blog/restrict-models-in-microsoft-foundry-with-azure-policy.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
