A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model
Hello @Umesh Dinkarrao Baradkar
You've framed it right โ Foundry traces give you token usage, latency and diagnostics, but they don't generate load. You need two separate planes: one to create load, and Foundry + App Insights to decompose it.
- Load and performance testing
Check your subnet first. For network-isolated Agent Service, concurrent sessions map roughly 1:1 to usable subnet IPs: /27 โ 32 IPs, ~27 usable, ~17 concurrent sessions; /26 โ 64 IPs, ~59 usable, ~50 sessions (documented max). Your 20+ target won't fit on a /27. Microsoft recommends /24 for production. Verify with:
az network vnet subnet show --ids <subnetId> --query "{prefix:addressPrefix, delegations:delegations[].serviceName}"
Prefix should be /26+, in RFC 1918 space (public and CGNAT 100.64.0.0/10 aren't supported), delegated to Microsoft.App/environments. Azure reserves 5 IPs per subnet โ stay at or below 80% utilization.
Agent type matters. Hosted agents consume subnet IPs (dedicated Micro VM + NIC each); prompt agents use a shared pool of ~10 IPs per project. Hosted limits: 100 active revisions, 1,000 total per agent, ~200 hosted agents per instance.
Your real ceiling is usually model quota. Rate limiting is applied at the model deployment level, and one user turn fans out into several model calls, retrievals and tool calls โ so TPM/RPM typically binds before the agent runtime does. Sanity check: TPM รท (avg tokens/turn ร turns per minute per user) should comfortably exceed 20. If not: backoff with jitter, or provisioned throughput.
Generate load against your application endpoint, not the raw agent. Azure Load Testing supports JMeter and Locust only โ k6 must be self-hosted. Locust runs in LocalRunner mode on every engine; scale out by adding engines.
Two signals that won't look like app errors: Azure Load Testing auto-stops when endpoints start throttling (that's a quota signal). And the portal doesn't expose IP utilization for delegated subnets โ treat data-proxy 5xx and session-creation 4xx as IP exhaustion, correlated against your VU ramp.
Measure: p50/p95/p99 latency, conversations/sec, success vs. failure, 429/5xx + retries, token usage, per-tool-call latency, timeouts.
2. Adaptive Cards / UI
Keep the agent out of the presentation layer. Adaptive Cards aren't a native Foundry output format โ documented channels are Microsoft 365 Copilot and Teams; anything else needs custom integration. Two supported paths:
- Publish from Foundry to Microsoft 365 โ auto-provisions Azure Bot Service + Entra ID. Fastest, minimal code.
- Microsoft 365 Agents Toolkit proxy app โ when you need custom logic, SSO, or managed infra.
Card interactions are handled by AgentApplication in the Microsoft 365 Agents SDK (Channel โ Hosting layer โ AgentApplication โ your handlers), with microsoft-agents-hosting-teams for Teams-specific handlers. For a custom web UI, render your own components and stream โ samples/dotnet/azure-ai-streaming in github.com/microsoft/Agents is a good start.
Worth weighing honestly: if rich UI is the priority and your orchestration is uncomplicated, Copilot Studio may be the better fit โ built-in orchestrator, reaches web/mobile/partner apps out of the box. Foundry wins when you need pro-code control and your own orchestrator.
One caveat if you scale later: Foundry Agent Service has no native LLM load balancing โ you front it with APIM or a load balancer, and tool/grounding connections stay pinned to their original region even when traffic is routed elsewhere.
Docs
- Agents networking deep dive (subnet sizing) โ https://learn.microsoft.com/azure/foundry/agents/concepts/agents-networking-deep-dive
- Limits, quotas, regions โ https://learn.microsoft.com/azure/foundry/agents/concepts/limits-quotas-regions
- Foundry OpenAI quotas โ https://learn.microsoft.com/azure/foundry/openai/quotas-limits
- Provisioned throughput โ https://learn.microsoft.com/azure/foundry/openai/concepts/provisioned-throughput
- Azure Load Testing overview โ https://learn.microsoft.com/azure/app-testing/load-testing/overview-what-is-azure-load-testing
- Locust quickstart โ https://learn.microsoft.com/azure/app-testing/load-testing/quickstart-create-run-load-test-with-locust
- High-scale loads โ https://learn.microsoft.com/azure/app-testing/load-testing/how-to-high-scale-load
- Set up agent tracing โ https://learn.microsoft.com/azure/foundry/observability/how-to/trace-agent-setup
- Custom engine agents โ https://learn.microsoft.com/microsoft-365/copilot/extensibility/overview-custom-engine-agent#development-approaches-for-custom-engine-agents
- Microsoft 365 Agents SDK โ https://learn.microsoft.com/microsoft-365/agents-sdk/
Thanks,
Manish.