Lesson 1 of 4 Compute, Observability and Developer Tooling

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.

Sort into groups

Prompt agent or hosted agent?

Exam skills 1.2.4

Decide which Foundry hosting option each statement describes.

Log in to try this activity Interactive activities are free with an account.

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.

Match the pairs

Compute features

Exam skills 1.2.4

Match each compute feature with the Azure service that provides it.

Log in to try this activity Interactive activities are free with an account.

Choosing against requirements

The following table compares the options against the five requirement categories in the skill statement.

OptionOperational effortControlTypical use
Foundry prompt agents and workflowsLowestConfiguration and tools onlyStandard agents and declarative orchestration
Foundry hosted agents (preview)LowCustom agent code in a containerAgent Framework or LangGraph code without own hosting
Azure Container AppsModerateContainer, scaling and networkingCustom agent services, MCP servers, workers
Azure Kubernetes ServiceHighestFull cluster controlLarge platforms, GPUs, strict network designs
Azure FunctionsLowFunction codeEvent-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.

Scenario questions

Choosing the host

Exam skills 1.2.4

Choose the compute option that meets each set of requirements.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

Check yourself

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.