Choosing Compute for Agents, Orchestrators and MCP Servers
This lesson compares the compute options for agents, orchestrators, tools and MCP servers, from fully managed agent hosting to self-managed Kubernetes, against scalability, reliability, operational efficiency, security and cost.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish prompt agents from hosted agents in Foundry Agent Service.
- Describe the strengths of Azure Container Apps, AKS and Azure Functions for agent workloads.
- Choose a compute option against the five requirement categories.
Managed agent hosting in Foundry
Prompt agents in Foundry Agent Service are defined declaratively (model, instructions, tools) and run entirely on Foundry: the service runs the agent loop, executes built-in tools, stores conversations, scales automatically and integrates tracing, guardrails and identity. Foundry workflows orchestrate several agents declaratively. These options minimize operational effort but limit custom code to tools.
Hosted agents (preview) run containerized agent code, such as Agent Framework or LangGraph applications, on Foundry-managed infrastructure. The Azure Developer CLI builds and deploys the container, and the agent gets a Foundry endpoint, an agent identity, versioning and observability. Hosted agents suit teams that need custom orchestration code without operating their own hosting.
Prompt agent or hosted agent?
Container Apps, AKS and Functions
Azure Container Apps runs custom agent services and MCP servers as containers with revisions, traffic splitting, scale to zero, KEDA-based scaling on queue length, virtual network integration and serverless GPUs. Azure Kubernetes Service (AKS) gives full control of networking, node pools, GPUs and multi-tenant clusters, at the cost of cluster operations.
Azure Functions suits event-driven tools, short tasks and MCP servers; the Flex Consumption plan adds fast scaling, virtual network integration and always-ready instances. Durable Functions runs long-running orchestrations with checkpoints, timers and external events, which suits approval workflows implemented in code.
Compute features
Choosing against requirements
The following table compares the options against the five requirement categories in the skill statement.
| Option | Operational effort | Control | Typical use |
|---|---|---|---|
| Foundry prompt agents and workflows | Lowest | Configuration and tools only | Standard agents and declarative orchestration |
| Foundry hosted agents (preview) | Low | Custom agent code in a container | Agent Framework or LangGraph code without own hosting |
| Azure Container Apps | Moderate | Container, scaling and networking | Custom agent services, MCP servers, workers |
| Azure Kubernetes Service | Highest | Full cluster control | Large platforms, GPUs, strict network designs |
| Azure Functions | Low | Function code | Event-driven tools, MCP servers, durable orchestrations |
Reliability is improved with availability zones, multiple regions for critical paths and retries; cost with scale to zero, right-sized replicas and the cheapest suitable model, which usually dominates compute cost in agent solutions.
Choosing the host
Hosting a LangGraph agent
A team has a LangGraph agent that must run in Azure with an Entra ID identity, traces in Foundry and versioned releases. The team has no Kubernetes skills and wants the least infrastructure to manage.
Foundry hosted agents fit: the LangGraph code is packaged in a container, deployed with azd and run by Foundry with an agent identity, versions and tracing. If the scenario forbids preview features, Azure Container Apps is the next option, with a managed identity and OpenTelemetry exporting to Application Insights. AKS would meet the requirements but contradicts the lack of Kubernetes skills and the least-management qualifier.
When is Azure Kubernetes Service the right host for agents?
Show answer
Only when full cluster control is a stated requirement. Foundry prompt agents, hosted agents or Container Apps need less operational effort.
Exam Tips
Remember for the exam
- Least operations: Foundry prompt agents. Custom code, managed: hosted agents (preview) or Container Apps.
- AKS only when full cluster control is a stated requirement.
- Durable Functions suits code-based long-running orchestrations.