{"id":2149,"date":"2026-04-15T05:00:56","date_gmt":"2026-04-15T05:00:56","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/all-things-azure\/?p=2149"},"modified":"2026-04-15T15:51:08","modified_gmt":"2026-04-15T15:51:08","slug":"hostedagent","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/all-things-azure\/hostedagent\/","title":{"rendered":"Choosing the Right Azure Hosting Model for AI Agents: A Deep Dive into Foundry Hosted Agents"},"content":{"rendered":"<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">AI agents are quickly moving from experiments to production\u2011critical components of modern applications. But while many teams know <em>how<\/em> to build agents, far fewer are confident they\u2019re <strong>hosting them on the right foundation<\/strong>.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">Most organizations start by deploying agents the same way they deploy microservices\u2014containers, functions, or app services. That approach works initially. But as agents evolve to support long\u2011running conversations, tool orchestration, stateful workflows, and continuous iteration, infrastructure decisions start to matter in new ways.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">Azure offers multiple ways to host AI agents, each with different tradeoffs across <strong>control, operational overhead, scalability, and agent\u2011native capabilities<\/strong>. Choosing the right option isn\u2019t about finding a single \u201cbest\u201d service\u2014it\u2019s about matching your agent\u2019s requirements to the right hosting model.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">In this post, we\u2019ll walk through the Azure agent hosting landscape\u2014from serverless and container\u2011based options to fully managed agent platforms\u2014and then take a deeper look at <strong>Microsoft Foundry Hosted Agents<\/strong>, a purpose\u2011built hosting model designed specifically for agentic workloads. Along the way, we\u2019ll highlight when each option makes sense and how to choose the one that best aligns with your architecture, team, and scale.<\/div>\n<h2>The Azure Agent Hosting Landscape<\/h2>\n<p>When deploying AI agents to production, you have several Azure options to consider like Azure Container Apps, Azure Kubernetes Service, Azure App Service, Azure Functions, Microsoft Foundry Agents and Microsoft Foundry Hosted Agents. Let\u2019s examine each option before diving deep into Hosted Agents.<\/p>\n<table class=\"code-line\" dir=\"auto\" data-line=\"10\">\n<thead class=\"code-line\" dir=\"auto\" data-line=\"10\">\n<tr class=\"code-line\" dir=\"auto\" data-line=\"10\">\n<th style=\"width: 178.635px;\">Hosting Option<\/th>\n<th style=\"width: 67.0417px;\">Control<\/th>\n<th style=\"width: 93.4688px;\">Complexity<\/th>\n<th style=\"width: 230.198px;\">Best For<\/th>\n<th style=\"width: 205.135px;\">Strengths<\/th>\n<th style=\"width: 243.521px;\">Considerations<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"code-line\" dir=\"auto\" data-line=\"12\">\n<tr class=\"code-line\" dir=\"auto\" data-line=\"12\">\n<td style=\"width: 178.635px;\"><strong>Azure Container Apps<\/strong><\/td>\n<td style=\"width: 67.0417px;\">High<\/td>\n<td style=\"width: 93.4688px;\">Medium<\/td>\n<td style=\"width: 230.198px;\">General containerized workloads, custom orchestration, full control over your container runtime while avoiding Kubernetes complexity.<\/td>\n<td style=\"width: 205.135px;\">Container control, KEDA autoscaling, VNet\/Dapr<\/td>\n<td style=\"width: 243.521px;\">Manual observability, self-managed conversation state<\/td>\n<\/tr>\n<tr class=\"code-line\" dir=\"auto\" data-line=\"13\">\n<td style=\"width: 178.635px;\"><strong>Azure Kubernetes Service<\/strong><\/td>\n<td style=\"width: 67.0417px;\">Very High<\/td>\n<td style=\"width: 93.4688px;\">High<\/td>\n<td style=\"width: 230.198px;\">Enterprise-scale, strict compliance,multi-cluster deployment, or complex networking<\/td>\n<td style=\"width: 205.135px;\">Max flexibility, multi-cluster, GitOps<\/td>\n<td style=\"width: 243.521px;\">High operational overhead, K8s expertise required<\/td>\n<\/tr>\n<tr class=\"code-line\" dir=\"auto\" data-line=\"14\">\n<td style=\"width: 178.635px;\"><strong>Azure App Service<\/strong><\/td>\n<td style=\"width: 67.0417px;\">Medium<\/td>\n<td style=\"width: 93.4688px;\">Low<\/td>\n<td style=\"width: 230.198px;\">Simple web-based agents, PaaS deployment model with no container orchestration<\/td>\n<td style=\"width: 205.135px;\">Managed PaaS, CI\/CD slots, Entra Auth<\/td>\n<td style=\"width: 243.521px;\">Instance-based scaling, no agent abstractions<\/td>\n<\/tr>\n<tr class=\"code-line\" dir=\"auto\" data-line=\"15\">\n<td style=\"width: 178.635px;\"><strong>Azure Functions<\/strong><\/td>\n<td style=\"width: 67.0417px;\">Low<\/td>\n<td style=\"width: 93.4688px;\">Low<\/td>\n<td style=\"width: 230.198px;\">Event-driven agents, serverless triggers,<\/td>\n<td style=\"width: 205.135px;\">Pay-per-execution, rich built-in triggers<\/td>\n<td style=\"width: 243.521px;\">Execution time limits, cold starts<\/td>\n<\/tr>\n<tr class=\"code-line\" dir=\"auto\" data-line=\"16\">\n<td style=\"width: 178.635px;\"><strong>Microsoft Foundry Agents<\/strong><\/td>\n<td style=\"width: 67.0417px;\">Low<\/td>\n<td style=\"width: 93.4688px;\">Very Low<\/td>\n<td style=\"width: 230.198px;\">Prompt-based agents, built-in tools, managed, code-optional agent configured through the portal or SDK\u2014no containers, no infrastructure.<\/td>\n<td style=\"width: 205.135px;\">Zero infra, built-in tools, portal-driven<\/td>\n<td style=\"width: 243.521px;\">No custom framework, limited to model + tools<\/td>\n<\/tr>\n<tr class=\"code-line\" dir=\"auto\" data-line=\"17\">\n<td style=\"width: 178.635px;\"><strong>Microsoft Foundry Hosted Agents<\/strong><\/td>\n<td style=\"width: 67.0417px;\">Medium<\/td>\n<td style=\"width: 93.4688px;\">Very Low<\/td>\n<td style=\"width: 230.198px;\">Custom frameworks, agent-native deployment, simplicity of managed infrastructure with the flexibility of custom agent code,<\/td>\n<td style=\"width: 205.135px;\">BYO framework, built-in OTel, scale-to-zero<\/td>\n<td style=\"width: 243.521px;\">Preview SLAs, no private networking yet<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Deep Dive: Microsoft Foundry Hosted Agents<\/h2>\n<p>For teams that want the simplicity of managed infrastructure with the flexibility of custom agent code, <strong>Hosted Agents<\/strong> in Microsoft Foundry represent the sweet spot. This is where Azure meets agent-native deployment.<\/p>\n<h3>What Are Hosted Agents?<\/h3>\n<p>Hosted Agents are containerized agentic AI applications that run on <strong>Foundry Agent Service<\/strong>\u2014Microsoft\u2019s managed platform for AI agents. Unlike traditional container hosting, Hosted Agents provide:<\/p>\n<ul>\n<li><strong>Agent-native abstractions<\/strong>: Conversations, responses, and tool calls are first-class concepts<\/li>\n<li><strong>Managed lifecycle<\/strong>: Create, start, update, stop, and delete with simple API calls<\/li>\n<li><strong>Built-in observability<\/strong>: OpenTelemetry traces, metrics, and logs out of the box<\/li>\n<li><strong>Framework support<\/strong>: Bring LangGraph, Microsoft Agent Framework, or custom code<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1.webp\"><img decoding=\"async\" class=\"alignnone size-full wp-image-2181\" src=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1.webp\" alt=\"Hosted Agent Architecture\" width=\"1842\" height=\"1341\" srcset=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1.webp 1842w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1-300x218.webp 300w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1-1024x745.webp 1024w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1-768x559.webp 768w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/05\/Architecture-1-1536x1118.webp 1536w\" sizes=\"(max-width: 1842px) 100vw, 1842px\" \/><\/a><\/p>\n<h3>The Hosting Adapter: Bridging Frameworks to Foundry<\/h3>\n<p>The secret sauce of Hosted Agents is the <strong>Hosting Adapter<\/strong>\u2014a framework abstraction layer that exposes your agent as an HTTP service with built-in Foundry integration.<\/p>\n<p>For LangGraph agents, you simply wrap your graph with the adapter:<\/p>\n<p>from azure.ai.agentserver.langgraph import from_langgraph<\/p>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\"># Your LangGraph agent\r\ngraph = StateGraph(MessagesState)\r\ngraph.add_node(\"agent\", call_model)\r\ngraph.add_node(\"tools\", tool_node)\r\n# ... build your graph\r\n\r\napp = graph.compile()\r\n\r\n# Wrap with the hosting adapter - that's it!\r\nif __name__ == \"__main__\":\r\n\u00a0\u00a0\u00a0 from_langgraph(app).run()<\/code><\/pre>\n<p>For Microsoft Agent Framework:<\/p>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">from azure.ai.agentserver.agentframework import from_agent_framework\r\n\r\nagent = ChatAgent(\r\n\u00a0\u00a0\u00a0 chat_client=AzureAIAgentClient(...),\r\n\u00a0\u00a0\u00a0 instructions=\"You are a helpful assistant.\",\r\n\u00a0\u00a0\u00a0 tools=[get_local_time],\r\n)\r\n\r\nif __name__ == \"__main__\":\r\n\u00a0\u00a0\u00a0 from_agent_framework(agent).run()<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>The hosting adapter automatically provides:<\/p>\n<table width=\"100%\">\n<thead>\n<tr>\n<td width=\"207\">Capability<\/td>\n<td width=\"321\">What It Handles<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"207\"><strong>Protocol Translation<\/strong><\/td>\n<td width=\"321\">Converts Foundry Responses API \u2194 your framework\u2019s format<\/td>\n<\/tr>\n<tr>\n<td width=\"207\"><strong>Conversation Management<\/strong><\/td>\n<td width=\"321\">Message serialization, history management<\/td>\n<\/tr>\n<tr>\n<td width=\"207\"><strong>Streaming<\/strong><\/td>\n<td width=\"321\">Server-sent events for real-time responses<\/td>\n<\/tr>\n<tr>\n<td width=\"207\"><strong>Observability<\/strong><\/td>\n<td width=\"321\">TracerProvider, MeterProvider, LoggerProvider via OpenTelemetry<\/td>\n<\/tr>\n<tr>\n<td width=\"207\"><strong>Local Testing<\/strong><\/td>\n<td width=\"321\">Runs on localhost:8088 for local development<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Building and Deploying a Hosted Agent<\/h3>\n<p>Let\u2019s walk through deploying a LangGraph calculator agent to Microsoft Foundry.<\/p>\n<h4>Step 1: Define Your Agent Code<\/h4>\n<p>Create main.py with your LangGraph agent:<\/p>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">from langchain_core.tools import tool\r\nfrom langgraph.graph import MessagesState, StateGraph, START, END\r\nfrom azure.ai.agentserver.langgraph import from_langgraph\r\n\r\n@tool\r\ndef multiply(a: int, b: int) -&gt; int:\r\n\u00a0\u00a0\u00a0 \"\"\"Multiply two numbers.\"\"\"\r\n\u00a0\u00a0\u00a0 return a * b\r\n\r\n@tool\r\ndef add(a: int, b: int) -&gt; int:\r\n\u00a0\u00a0\u00a0 \"\"\"Add two numbers.\"\"\"\r\n\u00a0\u00a0\u00a0 return a + b\r\n\r\n# Build the graph\r\ntools = [multiply, add]\r\n# ... graph construction ...\r\n\r\napp = graph.compile()\r\n\r\nif __name__ == \"__main__\":\r\n\u00a0\u00a0\u00a0 from_langgraph(app).run()<\/code><\/pre>\n<h4>Step 2: Create the Agent Manifest<\/h4>\n<p>Define agent.yaml to describe your agent:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">name: CalculatorAgent\r\ndescription: A LangGraph agent that performs arithmetic calculations.\r\nmetadata:\r\n\u00a0 tags:\r\n\u00a0\u00a0\u00a0 - calculator\r\n\u00a0\u00a0\u00a0 - math\r\ntemplate:\r\n\u00a0 name: CalculatorAgentLG\r\n\u00a0 kind: hosted\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # This makes it a Hosted Agent\r\n\u00a0 protocols:\r\n\u00a0\u00a0\u00a0 - protocol: responses\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 version: v1\r\n\u00a0 environment_variables:\r\n\u00a0\u00a0\u00a0 - name: AZURE_OPENAI_ENDPOINT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 value: ${AZURE_OPENAI_ENDPOINT}\r\n\u00a0\u00a0\u00a0 - name: AZURE_AI_MODEL_DEPLOYMENT_NAME\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 value: \"{{chat}}\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # Resolved at runtime\r\nresources:\r\n\u00a0 - kind: model\r\n\u00a0\u00a0\u00a0 id: gpt-4o\r\n\u00a0\u00a0\u00a0 name: chat<\/code><\/pre>\n<h4>Step 3: Containerize with Docker<\/h4>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">FROM python:3.11-slim\r\n\r\nWORKDIR \/app\r\nCOPY requirements.txt .\r\nRUN pip install --no-cache-dir -r requirements.txt\r\n\r\nCOPY . .\r\n\r\n# The hosting adapter listens on port 8088\r\nEXPOSE 8088\r\n\r\nCMD [\"python\", \"main.py\"]<\/code><\/pre>\n<h4>Step 4: Deploy with Azure Developer CLI<\/h4>\n<p>The azd ai agent extension streamlines deployment:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Install the extension\r\nazd ext install azure.ai.agents\r\n\r\n# Initialize your project\r\nazd ai agent init\r\n\r\n# Build, push, and deploy in one command\r\nazd up<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>This single command: 1. Builds your container image 2. Pushes to Azure Container Registry 3. Creates the Foundry project (if needed) 4. Deploys model endpoints 5. Creates and starts your Hosted Agent<\/p>\n<h3>Managing Hosted Agent Lifecycle<\/h3>\n<p>Once deployed, manage your agent with the Azure CLI:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Start an agent (with scale-to-zero support)\r\naz cognitiveservices agent start \\\r\n\u00a0\u00a0\u00a0 --account-name myFoundry \\\r\n\u00a0\u00a0\u00a0 --project-name myProject \\\r\n\u00a0\u00a0\u00a0 --name CalculatorAgent \\\r\n\u00a0\u00a0\u00a0 --agent-version 1 \\\r\n\u00a0\u00a0\u00a0 --min-replicas 0 \\\r\n\u00a0\u00a0\u00a0 --max-replicas 3\r\n\r\n# Update replicas without creating a new version\r\naz cognitiveservices agent update \\\r\n\u00a0\u00a0\u00a0 --min-replicas 1 \\\r\n\u00a0\u00a0\u00a0 --max-replicas 5\r\n\r\n# Stop the agent\r\naz cognitiveservices agent stop \\\r\n\u00a0\u00a0\u00a0 --account-name myFoundry \\\r\n\u00a0\u00a0\u00a0 --project-name myProject \\\r\n\u00a0\u00a0\u00a0 --name CalculatorAgent \\\r\n\u00a0\u00a0\u00a0 --agent-version 1<\/code><\/pre>\n<h3>Invoking Your Hosted Agent<\/h3>\n<p>Use the Azure AI Projects SDK to invoke your agent:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">from azure.ai.projects import AIProjectClient\r\nfrom azure.identity import DefaultAzureCredential\r\n\r\nclient = AIProjectClient(\r\n\u00a0\u00a0\u00a0 endpoint=\"https:\/\/your-project.services.ai.azure.com\/api\/projects\/your-project\",\r\n\u00a0\u00a0\u00a0 credential=DefaultAzureCredential(),\r\n\u00a0\u00a0\u00a0 allow_preview=True,\r\n)\r\n\r\n# Get the OpenAI-compatible client\r\nopenai_client = client.get_openai_client()\r\n\r\n# Invoke the agent\r\nresponse = openai_client.responses.create(\r\n\u00a0\u00a0\u00a0 input=[{\"role\": \"user\", \"content\": \"What is 25 * 17 + 42?\"}],\r\n\u00a0\u00a0\u00a0 extra_body={\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"agent_reference\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"name\": \"CalculatorAgent\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"type\": \"agent_reference\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 }\r\n)\r\n\r\nprint(response.output_text)\r\n# Output: 25 * 17 = 425, then 425 + 42 = 467<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3>Built-in Observability<\/h3>\n<p>Hosted Agents automatically export telemetry to Application Insights (or any OpenTelemetry collector):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Traces are exported automatically - no code changes needed!\r\n# View in Azure Portal \u2192 Application Insights \u2192 Transaction Search<\/code><\/pre>\n<p>You can also stream container logs for debugging:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">curl -N \"https:\/\/{endpoint}\/api\/projects\/{project}\/agents\/{agent}\/versions\/1\/containers\/default:logstream?kind=console&amp;tail=100\" \\\r\n\u00a0 -H \"Authorization: Bearer $(az account get-access-token --resource https:\/\/ai.azure.com --query accessToken -o tsv)\"<\/code><\/pre>\n<h3>Conversation Management<\/h3>\n<p>Unlike raw container deployments where you manage state yourself, Hosted Agents integrate with Foundry\u2019s conversation system:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Create a persistent conversation\r\nconversation = openai_client.conversations.create()\r\n\r\n# First turn\r\nresponse1 = openai_client.responses.create(\r\n\u00a0\u00a0\u00a0 conversation=conversation.id,\r\n\u00a0\u00a0\u00a0 extra_body={\"agent_reference\": {\"name\": \"CalculatorAgent\", \"type\": \"agent_reference\"}},\r\n\u00a0\u00a0\u00a0 input=\"Remember: my favorite number is 42.\",\r\n)\r\n\r\n# Later turn - agent has context\r\nresponse2 = openai_client.responses.create(\r\n\u00a0\u00a0\u00a0 conversation=conversation.id,\r\n\u00a0\u00a0\u00a0 extra_body={\"agent_reference\": {\"name\": \"CalculatorAgent\", \"type\": \"agent_reference\"}},\r\n\u00a0\u00a0\u00a0 input=\"Multiply my favorite number by 10.\",\r\n)\r\n# Agent knows 42 from the previous turn<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3>Resource Scaling Options<\/h3>\n<p>Hosted Agents support flexible resource allocation:<\/p>\n<table>\n<thead>\n<tr>\n<td>CPU<\/td>\n<td>Memory<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0.25<\/td>\n<td>0.5 Gi<\/td>\n<\/tr>\n<tr>\n<td>0.5<\/td>\n<td>1.0 Gi<\/td>\n<\/tr>\n<tr>\n<td>1.0<\/td>\n<td>2.0 Gi<\/td>\n<\/tr>\n<tr>\n<td>2.0<\/td>\n<td>4.0 Gi<\/td>\n<\/tr>\n<tr>\n<td>4.0<\/td>\n<td>8.0 Gi<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>And horizontal scaling with replica configuration:<\/p>\n<table width=\"100%\">\n<thead>\n<tr>\n<td width=\"216\">Setting<\/td>\n<td width=\"312\">Description<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"216\">min-replicas: 0<\/td>\n<td width=\"312\">Scale to zero when idle (cost savings, cold start on first request)<\/td>\n<\/tr>\n<tr>\n<td width=\"216\">min-replicas: 1<\/td>\n<td width=\"312\">Always warm (no cold starts, steady cost)<\/td>\n<\/tr>\n<tr>\n<td width=\"216\">max-replicas: 5<\/td>\n<td width=\"312\">Maximum horizontal scale (preview limit)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Publishing to Channels<\/h3>\n<p>Once your agent is production-ready, publish it to multiple channels:<\/p>\n<ul>\n<li><strong>Web Application Preview<\/strong>: Shareable demo interface<\/li>\n<li><strong>Microsoft 365 Copilot &amp; Teams<\/strong>: Appear in the agent store<\/li>\n<li><strong>Stable API Endpoint<\/strong>: Consistent REST API for custom apps<\/li>\n<\/ul>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Publishing creates a dedicated agent identity\r\n# (separate from the project managed identity)<\/code><\/pre>\n<p><div class=\"alert alert-info\">Important: After publishing, reconfigure RBAC permissions since the project managed identity doesn&#8217;t transfer to the new agent identity.<\/div><\/p>\n<h2>Decision Framework: Choosing Your Hosting Option<\/h2>\n<p>Use this flowchart to select the right option:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree.webp\"><img decoding=\"async\" class=\"alignnone wp-image-2164\" src=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree.webp\" alt=\"DecisionTree image\" width=\"802\" height=\"612\" srcset=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree.webp 1298w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree-300x229.webp 300w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree-1024x782.webp 1024w, https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-content\/uploads\/sites\/83\/2026\/04\/DecisionTree-768x586.webp 768w\" sizes=\"(max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h2>What\u2019s Next<\/h2>\n<div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">AI agents introduce new architectural considerations that traditional application hosting models don\u2019t fully address. Conversations span multiple turns, tools execute on behalf of users, state must persist reliably, and observability needs to extend beyond simple request\/response metrics.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">Azure gives you flexibility across this spectrum. You can run agents on <strong>Functions<\/strong> for short, event\u2011driven tasks, on <strong>App Service or Container Apps<\/strong> for familiar PaaS and serverless container workflows, or on <strong>AKS<\/strong> when maximum control and enterprise customization are required. Each option has its place\u2014and understanding those tradeoffs is key to building reliable agent\u2011powered systems.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\"><strong>Microsoft Foundry Hosted Agents<\/strong> represent a shift toward an <strong>agent\u2011centric hosting model<\/strong>: one that abstracts infrastructure management while preserving the freedom to bring your own frameworks, code, and tools. By combining managed lifecycle, built\u2011in observability, conversation management, and seamless integration with Azure AI services, Hosted Agents let teams focus more on agent behavior and less on platform plumbing.<\/p>\n<\/div>\n<div class=\"paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol\">As agentic applications become more central to intelligent systems, hosting choices will increasingly influence velocity, reliability, and long\u2011term maintainability. Whether you\u2019re deploying your first agent or scaling a fleet of them across environments, choosing the right Azure hosting model early will pay dividends as your solution grows.<\/p>\n<p>Ready to start building? Check out the <a href=\"https:\/\/github.com\/microsoft-foundry\/foundry-samples\/tree\/main\/samples\/python\/hosted-agents\">Foundry Samples repository<\/a> for complete working examples, deploy a Hosted Agent, and experience what agent\u2011native hosting on Azure looks like in practice.<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p><strong>Resources:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"551\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"551\"><a href=\"https:\/\/learn.microsoft.com\/azure\/container-apps\/overview\" data-href=\"https:\/\/learn.microsoft.com\/azure\/container-apps\/overview\">Azure Container Apps Overview<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"552\"><a href=\"https:\/\/learn.microsoft.com\/azure\/aks\/what-is-aks\" data-href=\"https:\/\/learn.microsoft.com\/azure\/aks\/what-is-aks\">What is Azure Kubernetes Service (AKS)?<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"553\"><a href=\"https:\/\/learn.microsoft.com\/azure\/app-service\/overview\" data-href=\"https:\/\/learn.microsoft.com\/azure\/app-service\/overview\">Azure App Service Overview<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"554\"><a href=\"https:\/\/learn.microsoft.com\/azure\/azure-functions\/functions-overview\" data-href=\"https:\/\/learn.microsoft.com\/azure\/azure-functions\/functions-overview\">What is Azure Functions?<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"555\"><a href=\"https:\/\/learn.microsoft.com\/azure\/foundry\/agents\/overview\" data-href=\"https:\/\/learn.microsoft.com\/azure\/foundry\/agents\/overview\">What is Microsoft Foundry Agent Service?<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"555\"><a href=\"https:\/\/learn.microsoft.com\/azure\/ai-foundry\/agents\/concepts\/hosted-agents\">Hosted Agents Documentation<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"555\"><a href=\"https:\/\/learn.microsoft.com\/azure\/ai-foundry\/agents\/concepts\/runtime-components\">Agent Runtime Components<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"555\"><a href=\"https:\/\/learn.microsoft.com\/azure\/ai-foundry\/agents\/concepts\/development-lifecycle\">Agent Development Lifecycle<\/a><\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"555\"><a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/azure-developer-cli\/extensions\/azure-ai-foundry-extension\">Azure Developer CLI &#8211; AI Agent Extension<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>AI agents are quickly moving from experiments to production\u2011critical components of modern applications. But while many teams know how to build agents, far fewer are confident they\u2019re hosting them on the right foundation. Most organizations start by deploying agents the same way they deploy microservices\u2014containers, functions, or app services. That approach works initially. But as [&hellip;]<\/p>\n","protected":false},"author":211798,"featured_media":1743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[35,36,37,1,38,87,89],"tags":[84,85,53,69,45,83,86,136,2,93,135],"class_list":["post-2149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agents","category-ai-apps","category-ai-foundry","category-azure","category-app-development","category-containers","category-thought-leadership","tag-agentic","tag-agentic-workloads","tag-agents","tag-ai-agent","tag-ai-foundry","tag-ai-infrastructure","tag-ai-platform","tag-aks","tag-azure","tag-containers","tag-hosted-agents"],"acf":[],"blog_post_summary":"<p>AI agents are quickly moving from experiments to production\u2011critical components of modern applications. But while many teams know how to build agents, far fewer are confident they\u2019re hosting them on the right foundation. Most organizations start by deploying agents the same way they deploy microservices\u2014containers, functions, or app services. That approach works initially. But as [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/posts\/2149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/users\/211798"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/comments?post=2149"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/posts\/2149\/revisions"}],"predecessor-version":[{"id":2188,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/posts\/2149\/revisions\/2188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/media\/1743"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/media?parent=2149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/categories?post=2149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/all-things-azure\/wp-json\/wp\/v2\/tags?post=2149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}