Microsoft Foundry (Previously called AI Foundry) provides powerful capabilities for building and deploying AI agents and solutions. For enterprise customers, securing these deployments within their own network infrastructure is critical for compliance, governance, and integration with existing landing zones. The Bring Your Own (BYO) VNET deployment pattern enables organizations to secure and control both inbound and outbound access to Foundry Agent services while maintaining network isolation.
In this blog post, I’m sharing lessons learned from a recent Microsoft Foundry Agent Service deployment utilising the BYO VNET pattern. This approach is particularly valuable for organizations that need to:
Integrate Microsoft Foundry with existing hub and spoke network architecture
It’s important to note that there are multiple versions of AI Foundry in documentation. This blog focuses on Microsoft Foundry Classic Service. For a detailed explanation of the differences between Hub based and Projectbased Foundry experiences, refer to this blog.
Foundry team has published templates for both Bicep and Terraform that can be used for creating Foundry deployment using customer owned VNET. This deployment template requires below resources for a successful deployment
1. Agent Subnet with Delegation
Recommended minimum size: /26 or larger depending on scale requirements
Agent subnet delegated to Foundry with Subnet delegation using “Microsoft.App/environments” as below
2. Private Endpoints Subnet
Dedicated subnet for hosting private endpoints to Microsoft Foundry resources
NSG configuration is critical for controlling outbound access from the Microsoft Foundry delegated agent subnet. The following outbound rules represent the minimum required configuration:
Azure Firewall provides centralised control over outbound traffic from the Microsoft Foundry environment. Azure firewall processes rules in the following order:
Network Rules - Processed first
Application Rules - Processed if no network rule match
Configure network rules to allow traffic to Azure service tags:
AzureActiveDirectory - Port 443
InternalACATraffic
Key Configuration Note: Create an IP Group containing Container Apps internal IP ranges (100.64.0.0/10, 100.100.0.0/17, 100.100.128.0/19, 100.100.160.0/19, 100.100.192.0/19) to use as source addresses in firewall rules.
Validate agent responses using the chat playground. This tests:
End to end agent functionality
Knowledge retrieval from vector store
LLM endpoint connectivity (Using GPT4o in this example)Thread logs functionality to trace requests
This is another example where we are asking a relevant questions with knowledge provided (Microsoft annual report 2025). We get expected response with reference to uploaded content.
Comprehensive observability is essential for operating Microsoft Foundry in production. Enable diagnostic logging across all components to gain visibility into traffic flows and request patterns.
Having logs enabled on the firewall allows us to observe traffic flows from Microsoft Foundry delegated subnet. Looking at logs below, we can see communication from Foundry subnet, towards Microsoft Container Registry and towards Azure Container Apps endpoints.
Deploying Microsoft Foundry using the Bring Your Own VNET pattern provides enterprise grade security and network control for AI agent workloads. This blog post has demonstrated a comprehensive approach to securing Microsoft Foundry deployments through three critical layers: individual resource network configuration, subnet NSG rules, and centralised Azure Firewall policies.
Security in Depth: BYO VNET pattern enables defense in depth by combining multiple security controls from resource level private endpoints to network level traffic filtering. This layered approach ensures that Microsoft Foundry deployments meet enterprise security requirements while maintaining full functionality.
Private Endpoints Are Critical: All Microsoft Foundry resources should be configured with disabled public network access and accessed exclusively through private endpoints. This ensures traffic remains within your virtual network and integrates seamlessly with existing Azure landing zone.
Observability is Essential: Comprehensive logging across Azure Firewall, VNET Flow Logs, and resource specific diagnostics provides the visibility needed to troubleshoot issues, optimize performance, and maintain security compliance. The investment in proper logging pays dividends during operations.