Prepstellar
Get it on Google Play

AI-103 · Setting Up and Deploying in Foundry

20 cards

Configuring Agent Deployments

Swipe, scroll or use ← →
  1. Agents, versions, and the stable endpoint

    A model deployment answers prompts. An agent deployment has to answer a harder question: when you change the agent, what do your users get, and when?

    A Foundry project is a folder that groups related resources such as agents, files, and tools. An agent version is an immutable record of the agent's configuration, and any change, even a single prompt edit, creates a new version. The agent is the stable, consumer-facing representation: its identity, endpoint, and authorization surface stay consistent as its underlying versions evolve.

    The agent endpoint is the URL consumers call to invoke the agent. It's live the moment you create the agent, with no separate publish step, and the URL doesn't change as you roll out new versions. You configure which version it serves, which protocols it speaks, and how callers authenticate.

    1 / 20
  2. Agents, versions, and the stable endpoint

    Keep the four objects apart:

    Object What it is Changes when you edit?
    Project A folder for agents, files, and tools No
    Agent version An immutable record of the configuration A new one is created
    Agent The stable, consumer-facing entity No, it keeps its identity
    Agent endpoint The URL consumers call No, the URL stays the same

    So an edit never rewrites what is already running. It adds a version, and a separate setting decides whether that version gets traffic.

    2 / 20
  3. Quick check

    A developer adds one tool to an agent that customers already call. What changes for the customers' integration?

    1. ATheir endpoint URL changes to point at the new version

      The endpoint URL doesn't change as you roll out new versions. That stability is why consumers call the agent and not a version.

    2. BNothing about the URL; a new version exists behind it

      Right. Any change creates a new immutable version, while the agent endpoint keeps the same URL. Which version answers depends on the version selector.

    3. CThey must wait for a publish step before calls work again

      The endpoint is live from the moment the agent is created, with no separate publish step, so calls never stop working.

    3 / 20

  4. Choosing which version receives traffic

    The agent's version_selector determines how traffic routes to agent versions. With Always use latest, the default, 100% of traffic routes to the most recently created agent version, so a newly created version is immediately served. When pinned to a specific version, 100% of traffic routes to the version you select, called the active agent version, and new versions don't change what's served until you update the selector.

    With the version selector pinned, the stable agent endpoint sends all traffic to version 2, and the newer version 3 is not served until you change the pin.invoke100%no trafficConsumersTeams, appsAgent endpointstable URLVersion 1olderVersion 2pinnedVersion 3latest
    Consumers always call the same endpoint URL. The version selector, not the URL, decides which immutable version answers.
    4 / 20
  5. Choosing which version receives traffic

    Pin to a specific version when you need stability across new versions, such as when an agent is in production or published to end users in Teams or Microsoft 365. There's no traffic splitting: only one agent version can be active and receive traffic at a time.

    In the portal, you pin a version from the Publish dropdown. In code, you send PATCH /agents/{agent_name} with a FixedRatio rule at 100 percent, or, in Python, call project_client.agents.update_details on an AIProjectClient from the azure.ai.projects package, passing an AgentEndpointConfig whose VersionSelector holds a FixedRatioVersionSelectionRule.

    In plain words, the Python call says: for this agent, route one hundred percent of traffic to version two.

    5 / 20
  6. Quick check

    An agent serves Teams users in production while developers create a new version every day. Which setting keeps users on an approved version?

    1. AThe default Always use latest selector

      Always use latest serves every newly created version immediately, so each daily experiment would reach Teams users.

    2. BA pinned version selector on the approved version

      Right. Pinning sends 100% of traffic to the version you choose, and new versions don't change what's served until you update the selector.

    3. CA ten percent canary rule for each new version

      Traffic splitting isn't supported. Only one agent version can be active and receive traffic at a time.

    6 / 20

  7. Protocols and authorization schemes

    The endpoint can speak several languages at once, and each audience needs the right one. An agent can expose multiple protocols simultaneously: Responses, Activity Protocol, Invocations, A2A, and MCP (preview). The Activity Protocol is the one used by Azure Bot Service. A2A supports agent-to-agent delegation, and an agent card surfaces the agent's details and capabilities to consumers, including for A2A discovery.

    By default, the Responses protocol is enabled and authorization is set to Entra. Protocols and authorization schemes aren't yet configurable in the Foundry portal, so you use the REST API or the SDK.

    7 / 20
  8. Protocols and authorization schemes

    Three authorization schemes decide who may call:

    • With the Entra scheme, the caller must have the Foundry Agent Consumer role, or higher, such as Foundry User, on the Foundry project or agent scope. Principals that only interact with agents, without creating or editing them, should use the Foundry Agent Consumer role.
    • BotServiceRbac combines Azure Bot Service channel authorization with Azure RBAC, while BotServiceTenant lets anyone in your tenant invoke the agent.

    An agent published to Microsoft 365 or Teams must have the Activity protocol enabled and use a BotServiceRbac or BotServiceTenant authorization scheme. API key authentication isn't supported: use Microsoft Entra ID (Azure RBAC) to authorize callers.

    Audience Protocol Authorization
    Your own apps Responses Entra
    Teams or Microsoft 365 Activity Protocol BotServiceRbac or BotServiceTenant
    8 / 20
  9. Quick check

    A partner team only needs to call your agent through the Entra scheme, with least privilege. Which role fits?

    1. AFoundry User on the whole Foundry project

      Foundry User works for calling, but it also allows creating and editing agents, which is more than the partner needs.

    2. BAn API key issued for the partner's application

      API key authentication isn't supported on agent endpoints. Callers authenticate with Microsoft Entra ID.

    3. CFoundry Agent Consumer on that agent's scope

      Right. The Foundry Agent Consumer role is meant for principals that only interact with agents, and the agent scope keeps the grant as narrow as possible.

    9 / 20

  10. Keep your progress in the app

    That’s 3 of 7 quick checks. In the app they stay answered, and every lesson remembers where you left off.

    Get it on Google Play Keep reading here
  11. Publishing to Teams from a private network

    A common enterprise case: the Foundry account has public network access turned off, yet the agent must appear in Teams.

    If your project disables public network access, set enable_m365_public_endpoint to true inside the activity protocol configuration before you publish the agent to Microsoft Copilot or Teams. Foundry applies this network exception only to the Activity Protocol route, so other agent protocols and project APIs remain private. Microsoft 365 doesn't support private network connectivity for agents and requires the endpoints it invokes to be routable over the public internet.

    10 / 20
  12. Publishing to Teams from a private network

    Service-managed source IP filtering allows requests delivered through Azure Bot Service or Microsoft 365 infrastructure, and you don't need to change the account's network settings or configure public ingress in your virtual network. Network restrictions don't replace authorization, so keep BotServiceRbac or BotServiceTenant configured.

    One more trap: because that PATCH replaces protocol_configuration and authorization_schemes, include every protocol and authorization scheme that the endpoint must retain. Sending only the activity block would silently drop Responses and Entra.

    11 / 20
  13. Quick check

    The account blocks public network access, and the agent must reach Teams while all other APIs stay private. What do you change?

    1. ATurn public network access back on for the Foundry account

      That would make Teams work, but it also exposes the other protocols and project APIs, which must stay private.

    2. BSet enable_m365_public_endpoint to true in the activity configuration

      Right. The setting opens only the Activity Protocol route, with source IP filtering, and leaves every other protocol and project API private.

    3. CAdd public ingress rules to the virtual network of the project

      You don't need to configure public ingress in your virtual network; the exception is applied to the Activity Protocol route by the service.

    12 / 20

  14. The legacy Agent Application model

    You will still meet the older way to share an agent. Publishing an agent as an Agent Application is the legacy publishing experience. Publishing creates an Agent Application resource with its own invocation URL, authentication policy, unique Entra agent identity, and unique Entra agent blueprint, plus a deployment child resource that references the agent version and supports start and stop. Publishing requires the Foundry Project Manager role on the Foundry resource scope.

    In the legacy model, the deployment type is Managed for prompt agents and Hosted for hosted agents, and only hosted deployments take minReplicas and maxReplicas.

    13 / 20
  15. The legacy Agent Application model

    The identity change is what breaks things after publishing. Because the identity changes, permissions don't transfer automatically: you must reassign RBAC permissions to the new agent identity, or tool calls that worked during development fail with authorization errors.

    Callers need the Foundry User role on the Agent Application resource, because the Foundry Agent Consumer role doesn't grant access to invoke Agent Applications. An Agent Application can use either Responses or Activity Protocol, one at a time. With Responses, it supports only the stateless POST /responses call, so the client must store conversation history for multi-turn conversations.

    Legacy Agent Application New agent endpoint
    Separate Azure resource with its own identity Endpoint live when the agent is created
    Callers need Foundry User on the application Callers need Foundry Agent Consumer or higher
    Responses or Activity, one at a time Several protocols at once
    14 / 20
  16. Quick check

    Right after publishing a legacy Agent Application, tool calls start failing with authorization errors. What fixes them?

    1. AGranting callers Foundry User on the application resource

      Caller roles control who can invoke the application. They don't give the agent's own identity access to the tools it calls.

    2. BRestarting the deployment that references the version

      A restart doesn't change permissions. The agent is running; its tool calls are rejected because its new identity lacks the roles.

    3. CReassigning the RBAC roles to the new agent identity

      Right. Publishing gives the application its own Entra agent identity, and permissions don't transfer automatically, so the roles must be reassigned.

    15 / 20

  17. Hosted agents: when and how

    Prompt agents cover most needs. Hosted agents exist for the cases where you need your own code.

    Hosted agents are your own code packaged as a container image, unlike prompt-based agents, which are defined entirely through prompts and tool configuration. Choose them when you need to bring your own code or framework, accept webhooks or non-OpenAI payloads through the Invocations protocol, control CPU and memory, run stateful workloads, or run long-lived work resiliently. You push the image to Azure Container Registry, and at deployment Agent Service pulls it, assigns a dedicated Microsoft Entra agent identity, and exposes a dedicated endpoint.

    The Responses protocol lets the platform manage conversation history, while Invocations accepts arbitrary JSON and leaves session management to your code. If you aren't sure, start with Responses, because a hosted agent can support both protocols simultaneously.

    16 / 20
  18. Quick check

    An agent must accept Stripe webhook payloads and run existing Microsoft Agent Framework code. Which setup fits?

    1. AA hosted agent exposing the Invocations protocol

      Right. Your own framework code needs a hosted agent, and Invocations accepts the webhook's own payload format as arbitrary JSON.

    2. BA prompt agent exposing the Responses protocol

      Prompt agents are defined through prompts and tool configuration, so they cannot run framework code, and Responses expects an OpenAI-compatible payload.

    3. CA hosted agent exposing only the Activity protocol

      The Activity protocol carries Teams and Microsoft 365 traffic. A webhook sender cannot speak it.

    17 / 20

  19. Hosted agent versions, sessions, and sizing

    Each version is an immutable record of the container image, resource allocation, environment variables, and protocol configuration, so to update your agent you create and deploy a new version. Hosted agents run in per-session, VM-isolated sandboxes, and the idle timeout can be 2 through 60 minutes, with a 15-minute default.

    Sandbox sizes are 0.5 vCPU with 1 GiB, 1 vCPU with 2 GiB, or 2 vCPU with 4 GiB.

    18 / 20
  20. Hosted agent versions, sessions, and sizing

    The cost model surprises people. The CPU and memory you set describe a single session, and billing is based on CPU and memory consumed across all active sessions, so oversizing multiplies cost by your concurrency. Hosted agents scale per session, not per replica, so there's no replica count to configure. Don't put secrets in container images or environment variables.

    A worked example: a version sized at 2 vCPU that never uses more than a fraction of it, running two hundred concurrent sessions, pays for that unused headroom two hundred times. The fix is a new version at a smaller size, retested under the same load.

    19 / 20
  21. Quick check

    A hosted agent sized at 2 vCPU with 4 GiB peaks far below its allocation across many sessions. How do you cut cost?

    1. ALower the replica count on the current version

      Hosted agents scale per session, not per replica, so there is no replica count to configure.

    2. BEdit the current version to 1 vCPU with 2 GiB

      Resource allocation is part of an immutable version, so it cannot be edited in place.

    3. CDeploy a new version sized at 1 vCPU with 2 GiB

      Right. Billing covers CPU and memory across all active sessions, and since versions are immutable, a smaller size means a new version.

    20 / 20

  22. 7 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

    Take this lesson’s test → Get it on Google Play
← Previous Get it on Google Play Next card →

The whole course, on your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.

Get it on Google Play

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review