Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 4 of 39
❮Prev Next❯

Configure Model and Agent Deployments

Module 1: Plan & Manage ⏱ 9 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    A model deployment pins a model name and version, a deployment type, capacity (tokens per minute, or PTUs), a version upgrade policy and a guardrail. Pin a version when behaviour must not change, and choose an upgrade option if you want newer defaults. An agent gets a new version every time its definition changes, so you can test one version, publish it, and roll back by pointing the endpoint at the earlier version. Apps call the project endpoint with the deployment name or the agent name, never the model name.

    Simulate it » No Azure account needed

    Exam objective: 1.2.3 Configure model and agent deployments. (Skills measured as of April 16, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Configure a model deployment and agent versions Deploy a model with a pinned version, capacity and a guardrail.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Open <strong>Models + endpoints</strong>. Apps call a <strong>deployment</strong> by its name, never the model directly. Select <strong>+ Deploy model</strong>.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Open Models + endpoints. Apps call a deployment by its name, never the model directly. Select + Deploy model.
    2. Customise the deployment: name, type, model version, upgrade policy, TPM and the guardrail.
    3. Pinning a version stops surprise behaviour changes. Watch the retirement date: before it, test the new version and move to it on your schedule.
    4. Every save of an agent creates a new, immutable version. The published endpoint still serves v2 until you choose otherwise.
    5. Publishing gives the agent a stable endpoint that points at the version you pick. Rolling back is just pointing it at v2 again.
    6. In code, create_version does the same, which is how a pipeline ships agents. Evaluate v3 before you publish it.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    A model update changed answers overnight and nobody could roll the agent back.

    😊 THE SOLUTION

    Pin model versions, version every agent change and publish the version you trust.

    • Surprise model upgrades✓ Pinned version and an upgrade policy
    • Edits overwrite the agent✓ Immutable agent versions
    • No way back✓ Point the endpoint at the last good version
    🛠️ Solved with: Deployments and agent versions

    Start with a question

    What happens to your app when the model behind it quietly changes?

    Asha’s team shipped a refund assistant that always answered in a tidy three-line format. A month later answers started arriving in paragraphs. Nobody had changed the code. The deployment was set to follow new default model versions, and a new default had arrived.

    Deployment settings are part of your app. The version, the capacity and the guardrail decide how it behaves as much as your prompt does.

    Explain it like I’m 10

    The technical explanation

    Configure a model deployment

    In the Foundry portal: Models + endpoints → Deploy model → choose the model → Customize:

    SettingWhat it controls
    Deployment nameThe name your code calls. Keep it stable and descriptive.
    Model versionThe exact release. Pick one when behaviour must not change.
    Deployment typeGlobal, Data Zone, Standard, Provisioned or Batch.
    Tokens per minute (capacity)The slice of quota this deployment gets, with matching requests per minute.
    Version upgrade policyNo auto upgrade, upgrade when a new default arrives, or upgrade only near retirement.
    GuardrailThe set of controls applied to prompts and answers.
    az cognitiveservices account deployment create -n contoso-ai -g rg-agents \
      --deployment-name gpt-4.1-mini --model-name gpt-4.1-mini --model-version 2025-04-14 \
      --model-format OpenAI --sku-name DataZoneStandard --sku-capacity 50

    Plan changes like code: when a model version retires, deploy the new one beside the old under a new name, test, then move traffic.

    Agents are versioned

    An agent definition holds the model deployment, instructions and tools (file search, code interpreter, MCP, functions, knowledge bases). Each change creates a new version with its own ID. You choose which version serves traffic.

    from azure.ai.projects import AIProjectClient
    from azure.ai.projects.models import PromptAgentDefinition
    from azure.identity import DefaultAzureCredential
    
    project = AIProjectClient(endpoint=PROJECT_ENDPOINT, credential=DefaultAzureCredential())
    agent = project.agents.create_version(
        agent_name="support-agent",
        definition=PromptAgentDefinition(model="gpt-4.1-mini", instructions="Answer only from the policy knowledge base."),
    )
    print(agent.name, agent.version)

    A safe release looks like this:

    1. Create the new version in a dev project and run your evaluation set.
    2. Promote the same definition to the next environment.
    3. Watch metrics and continuous evaluation after release.
    4. If scores drop, switch back to the previous version. Nothing was overwritten.

    Applications reach all of it through the project endpoint (https://<resource>.services.ai.azure.com/api/projects/<project>) with Microsoft Entra ID, not a key.

    Architect level Two deployments of the same model

    You can deploy the same model twice under different names, for example chat-prod with high capacity and a strict guardrail, and chat-eval with low capacity for test runs. Quota is shared across deployments of that model, so each one you add shrinks what’s left. Delete test deployments when you’re done with them.

    Real-world business scenario

    Payments

    Contoso Pay (fictional)

    The problem
    A silent model upgrade changed the tone of refund explanations, and a hurried prompt edit on the live agent made things worse with no way back.
    What they used
    A pinned gpt-4.1-mini version with no auto upgrade, a strict guardrail attached to the deployment, and agent versions: every prompt change became a new version tested in dev before the endpoint was switched.
    Why that choice
    Pinning stopped surprise changes, and versions turned a rollback into a switch of the active version.
    The result
    The team shipped prompt changes weekly and rolled one back in minutes when a score dropped.

    When to use it and when not to

    ✓ Use it when…

    • Behaviour must be predictable between releases.
    • You want to test a model or prompt change before users see it.
    • Different environments need different capacity and guardrails.

    ✕ Think twice when…

    • You edit a live agent with no new version and no tested fallback.
    • You hard-code a model name in app code.
    • You never delete old test deployments, so quota drains away.

    ↔ Alternatives to consider

    • Auto upgrade for low-risk apps where newer is always welcome.
    • A percentage rollout by sending part of the traffic to the new deployment first.
    • A model router deployment that picks a model per request.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A regulated application must keep identical model behaviour until your team approves a change. What should you configure on the deployment?

    Question 2

    Question 2 of 5

    An app code uses the name of a model in each request, and a new model must replace it without code changes. What should the app call instead?

    Question 3

    Question 3 of 5

    An agent in production begins giving poor answers after instructions were edited. Earlier versions were saved.

    What is the fastest safe fix?

    Question 4

    Question 4 of 5

    Which setting of a model deployment determines how many tokens per minute it can process?

    Question 5

    Question 5 of 5

    Which change to an agent creates a new agent version?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Why does your code use a deployment name and not the model name?

    Model answer

    Because the deployment is what I configure in Foundry: version, capacity, guardrail. If I need a newer model, I change the deployment, and the code keeps working. The name is a stable handle.

    Intermediate What does the version upgrade policy do?

    Model answer

    It controls what happens when a new default version comes out. With no auto upgrade, my deployment stays pinned until the version retires. With the other options, Azure moves it to the new default on a schedule. I pin for regulated apps and re-run my evaluations before changing.

    Experienced developer Walk me through rolling out a new agent prompt safely.

    Model answer

    I create a new agent version with the changed instructions, test that version against my evaluation set in a dev project, and only then point production at it. If users report problems, I switch the active version back to the previous one. Versions are kept, so nothing is lost.

    Scenario A model version is being retired in 60 days and your app depends on its exact wording. What do you do?

    Model answer

    I'd deploy the replacement version next to the old one under a new deployment name, run my test set against both, adjust prompts where scores drop, then switch traffic with a percentage rollout and finally delete the old deployment. I wouldn't wait for the forced upgrade date.

    Quick revision

    Key points

    • A deployment pins model, version, deployment type, capacity, upgrade policy and guardrail.
    • Code calls the deployment name, so the model behind it can change.
    • Pin the version when behaviour must be stable, and re-test before upgrading.
    • Every agent change creates a new version. The endpoint serves the version you choose, so rollback is a switch.
    • Capacity is per deployment, taken from the quota for that model and deployment type.

    Important terminology

    Deployment name
    The name you give a model deployment. Your code calls this name, not the model name, so you can swap the model behind it.
    Model version
    A dated release of a model, such as 2025-04-14. A deployment uses the version you pick or follows the default.
    Version upgrade policy
    The setting that decides whether a deployment stays on its pinned version, moves to a new default when one appears, or upgrades once the old one nears retirement.
    Agent version
    A saved snapshot of an agent's model, instructions and tools. Each change creates a new version, and the endpoint serves the version you choose.
    Project endpoint
    The URL of a Foundry project, which apps use through the Foundry SDK to reach agents, deployments and tools.
    Capacity
    The throughput slice assigned to a deployment: thousands of tokens per minute for pay-per-token types, or PTUs for provisioned types.

    Common mistakes

    • Letting auto upgrade change a regulated app's model without re-running evaluations.
    • Calling the model name instead of the deployment name.
    • Editing the live agent with no test version, then having nothing to roll back to.

    Exam tips

    • "Behaviour must not change until we approve" = pin the version, no auto upgrade.
    • "Undo a bad agent release quickly" = switch to the previous agent version.
    • "Apply content rules to a deployment" = attach a guardrail to it.

    Five quick revision questions

    1. 1.What do you call from code, the deployment name or the model name?Show

      The deployment name.

    2. 2.What creates a new agent version?Show

      Any change to its model, instructions or tools.

    3. 3.How do you roll back an agent?Show

      Point the endpoint at the earlier version.

    4. 4.Where does a deployment's capacity come from?Show

      The quota for that model and deployment type.

    5. 5.Which setting stops a deployment moving to a new default model version?Show

      A pinned version with no auto upgrade.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: CI/CD for Foundry Projects

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.