What it costs and what will bite you

Lesson 5 of 5 in Microsoft Foundry Agents in Practice: Identity, Boundaries, Guardrails, Traces, Bills.

You cannot forecast an agent bill from a price list, but you can forecast its shape — and on Foundry the shape follows directly from the agent type you chose.

Microsoft’s own comparison table puts it plainly: prompt agents are billed as per-call inference plus tool usage. Hosted agents add container compute on top — inference, tools, and the compute running your code. That is the entire structural difference, and it is why "should this be a prompt agent?" is a cost question as much as an architecture one. Scaling follows the same split: prompt agents scale with request volume with no compute for you to manage, while hosted agents scale container instances per session and request volume, with the container compute Foundry-managed.

So the first cost lever is not a discount. It is not paying for a container you did not need.

Two agent types, two bill shapes (Microsoft Learn — Agents in Microsoft Foundry, compare agent types, checked 2026-09)
Agent typeDocumented billing dimensionsScaling behaviourWhat actually moves the number

Prompt agent (declarative, configuration-only)

Per-call inference + tool usage.

Scales with request volume; no compute to manage.

Tokens per call and calls per task. Loop length is the multiplier: a task that averages six model calls costs six times a task that averages one, before anyone touches a price page.

Hosted agent (your code in a container)

Per-call inference + tool usage + container compute.

Container instances scale per session and request volume, Foundry-managed.

Everything above, plus how long sessions stay warm. Idle timeout is a billing dial disguised as a latency setting.

For hosted agents, the session lifecycle is where cost, latency and correctness all meet — so the documented numbers are worth holding precisely.

Sessions have a configurable idle timeout of 2 to 60 minutes, default 15. On idle, the platform deprovisions compute and persists session state — the sandbox filesystem ($HOME and /files) — which is what makes scale-to-zero with stateful resume possible: state is automatically restored when an idle session resumes. A session is permanently deleted after 30 days of inactivity. Separately, hosted agents get a durable server-backed key-value state store of keyed JSON items that persists independently of compute — surviving crashes, restarts and idle eviction — with a default 30-day item idle window that writes renew, and it can be configured never to expire. It can hold framework checkpoints for LangGraph or Agent Framework, and can partition items per end user for multitenant agents.

Three clocks, then, and they are not the same clock: session (compute plus filesystem), conversation (durable message history — in a Standard setup, in your Cosmos DB), and state-store item (your keyed JSON). A retention policy that only mentions one of them is not a retention policy.

Gotcha 1 · The account-creation decision you cannot revisit

Network injection must be configured when the Foundry account is created and cannot be added or changed later. Everything else in this module is reconfigurable; this is not.

Operational translation: put "will anything here ever need private networking?" on the account-provisioning checklist, next to region and subscription. And remember that not all agent tools support network isolation, so the isolated account trades some catalogue breadth for the boundary.

Gotcha 2 · Do not build on visual workflows — they retire 1 December 2026

Foundry visual workflows are preview today and Microsoft is retiring them on December 1, 2026: after that date the visual designer and in-portal workflow execution are unsupported. The documented migration targets are Microsoft Agent Framework (code-first or declarative YAML), Azure Logic Apps, or direct A2A agent-to-agent connections. Exported workflow YAML remains runnable when deployed as a hosted agent, and workflows are no longer a separate agent type.

This is the clearest "do not learn the deprecated path" signal in the Azure pack. If you need declarative multi-agent orchestration that will still exist in 2027, start from Agent Framework.

Gotcha 3 · Three retirement dates that decide migration order

From the migration and what’s-new pages, as documented in September 2026: the Azure OpenAI Assistants API sunsets and the azure-ai-inference package retires on August 26, 2026; Agents (classic) — the Assistants-style threads/runs/messages service — is deprecated with retirement on March 31, 2027; and visual workflows end on December 1, 2026.

The sharp edge underneath: no migration path exists from hub-based projects or Azure OpenAI Assistants to Foundry agents. Moving means rebuilding on the new runtime shape — agents, conversations and responses, with agents identified by name plus version rather than a GUID. Plan it as a rewrite of the platform glue, not a config change, and check the current dates before you build the plan.

Gotcha 4 · Preview is load-bearing here — inventory it

As of September 2026, a striking share of the day-to-day surface is preview: agent guardrails and the tool-call/tool-response intervention points, network egress controls, Spotlighting, Toolbox tool search, managed MCP servers via connector namespaces (explicitly "no SLA, not recommended for production"), the incoming A2A endpoint, external agent registration, workflows, and the agent optimizer (limited preview).

Meanwhile the portal, core Agents, publishing to Microsoft 365 Copilot/Teams, Routines, and tracing for prompt and hosted agents are documented as GA. Write the preview list into your design doc explicitly, because "the platform supports it" and "the platform supports it with an SLA" are different sentences — and the list moves monthly.

Gotcha 5 · The project-creation date that gates private container registries

Hosted agents with a private Azure Container Registry are supported only for Foundry projects created after June 25, 2026. An older project cannot simply opt in.

It is a small fact with an outsized effect on enterprise rollouts, because "our images must come from our private registry" is a common non-negotiable. Check the project’s creation date before promising it.

Gotcha 6 · Context is a cost centre, and there are levers

Two documented levers worth knowing. Toolbox tool search (preview) hides tools by default and exposes only two meta-tools — tool_search and call_tool — so a toolbox can hold hundreds of tools without flooding the model’s context window; critical tools can be pinned or auto-pinned. Microsoft cites token cost, context capacity and tool-selection accuracy as the motivations, which is the rare feature that improves quality and spend together.

Second, Agent Service lets you swap catalogue models without changing agent code, and the model router (version 2025-11-18, GA) can route across Anthropic Claude models alongside OpenAI models, with routing profiles and custom subsets. So "use a cheaper model for the easy 80%" is a configuration change rather than a refactor — provided your evals can tell you whether it stayed good enough.

Microsoft Foundry on the cloud timeline

  • 2023-11-01Amazon Bedrock Agents launches:

    The first major cloud-managed agent service arrived in November 2023: action groups backed by Lambda, a knowledge-base integration, and a hosted orchestration loop. It marks the point where agents became infrastructure to procure, not just code to write — and it is now “Agents Classic” in maintenance mode, which is its own lesson about building on managed abstractions.

  • 2025-03-04Vertex AI Agent Engine reaches GA:

    Google’s managed agent runtime — previously “LangChain on Vertex AI” — went generally available with billing starting the same day. That is sixteen months after Amazon Bedrock Agents made a managed agent loop something you procure rather than write.

  • 2025-04-09Google ADK launches in preview; Agent Builder becomes a suite:

    The open-source Agent Development Kit arrived in preview at the same event, with Agent Engine gaining ADK integration and an Example Store, Agent Garden debuting, and the original Agent Builder renamed AI Applications. ADK Python reached a production-ready 1.0.0 at I/O on 20 May 2025, alongside a Java SDK.

  • 2025-05-01Azure AI Foundry Agent Service reaches GA:

    Microsoft’s managed agent service went generally available around Build 2025 with connected agents, agent tracing, and Logic Apps triggers. Everything about it — the name, the API, the threads-and-runs model — changes at least twice in the eighteen months that follow.

  • 2025-07-16AWS previews Amazon Bedrock AgentCore:

    Seven services in four regions — Runtime, Memory, Gateway, Browser Tool, Code Interpreter, Observability, Identity — sold as primitives rather than one opinionated agent object. This is AWS conceding that its 2023 Bedrock Agents abstraction was the wrong shape.

  • 2025-10-10Gemini Enterprise becomes Google’s agent front door:

    Announced as “the new front door for AI in the workplace”: Gemini models, a no-code workbench, prebuilt agents, connectors, and governance in one product, succeeding Agentspace. The pattern across all three clouds is the same — the platform sells governance and identity, not the model.

  • 2025-10-13Amazon Bedrock AgentCore goes GA:

    General availability in nine regions with VPC and PrivateLink, CloudFormation, tagging, A2A support in Runtime, MCP servers as Gateway targets, and consumption-based pricing. A cloud agent platform reaching GA with both protocols wired in is the moment the protocol layer stopped being optional.

  • 2025-11-01Ignite 2025: Microsoft Foundry, and identity for agents:

    Microsoft renamed the platform again — Azure AI Studio to Azure AI Foundry (Ignite 2024) to Microsoft Foundry — and shipped a Responses-API-based “Agents v2” model plus Microsoft Entra Agent ID, giving agents first-class directory identities. The naming churn is noise; agents becoming principals in your identity system is not.

  • 2025-12-01AgentCore adds Policy and Evaluations in preview:

    Policy takes natural-language rules, compiles them to Cedar, and enforces them at the Gateway — authorization outside the model, where an injection cannot argue with it. Evaluations arrived in preview with 13 built-in evaluators, alongside episodic memory and bidirectional streaming.

  • 2025-12-16Agent Engine Sessions and Memory Bank reach GA:

    Google made conversation state and long-term memory generally available as managed services, cut Runtime pricing, added seven regions, and scheduled usage-based charging for Sessions, Memory Bank, and Code Execution from 28 January 2026. Memory became a billable dependency, which is a design constraint as much as a cost one.

  • 2026-03-01AgentCore Evaluations, Policy, and CLI reach GA:

    Evaluations went GA in nine regions and Policy in thirteen, with the AgentCore CLI. Twelve months after the first cloud agent runtime reached GA, the parts reaching GA are measurement and authorization — the two things nobody could buy in 2023.

  • 2026-05-01Microsoft Agent 365 reaches GA:

    Microsoft’s control plane for observing, governing, and securing agents shipped generally available, bundled into the new Microsoft 365 E7 suite. Read it with Entra Agent ID: the enterprise question moved from “can we build agents?” to “how many are running, owned by whom, with what permissions?”

  • 2026-07-30Bedrock Agents Classic closes to new customers:

    The 2023 service became Agents Classic in maintenance mode: no new customers from this date and no new features — but AWS states there is no end-of-life date and no migration deadline for existing customers. The abstraction that launched the cloud agent era lasted under three years; plan your own portability accordingly.

  • 2026-08-01AgentCore Agent Registry and Runtime Instances reach GA:

    The Agent Registry — a governed catalog of agents, tools, and MCP servers with AWS Organizations auto-detection and CMK encryption — went GA alongside Runtime Instances (EC2-backed sessions up to 14 days, GPU families) and AgentCore payments. AWS and Microsoft both now sell an agent inventory, which tells you what their customers were struggling with.

  • 2026-08-26The Azure OpenAI Assistants API sunsets:

    Assistants API workloads and the azure-ai-inference package reached end of service, pushing everyone onto the GA Foundry Agents service and the openai package. Two more deadlines are already on the calendar: Foundry visual workflows retire on 1 December 2026, and Agents (classic) — the threads/runs/messages model — retires on 31 March 2027.

  • 2026-09-01Google’s agent stack reappears as Gemini Enterprise Agent Platform:

    Observed on 13 September 2026: the Vertex AI agent docs are frozen and folded into Gemini Enterprise Agent Platform, Agent Engine is presented as Agent Runtime, and ADK has moved to adk.dev with a 2.x line (graph workflows, five languages). No announcement date for the rebrand was established, so treat this as an “observed by” marker — and as a reminder that in this space the product name is the least stable thing about it.

Interactive flashcard deck.

Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.