Configure Model and Agent Deployments
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 neededExam 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.
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
- Open Models + endpoints. Apps call a deployment by its name, never the model directly. Select + Deploy model.
- Customise the deployment: name, type, model version, upgrade policy, TPM and the guardrail.
- Pinning a version stops surprise behaviour changes. Watch the retirement date: before it, test the new version and move to it on your schedule.
- Every save of an agent creates a new, immutable version. The published endpoint still serves v2 until you choose otherwise.
- Publishing gives the agent a stable endpoint that points at the version you pick. Rolling back is just pointing it at v2 again.
- 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.
🖱️ Drag to rotate · scroll or pinch to zoom
Configure deployments and agent versions
A deployment pins a model, a model version, a deployment type, capacity (TPM) and a guardrail. An agent gets a new version every time you change it; the endpoint serves the version you choose, so you can roll back.
🤔 What happens if…
Read this tour as text
- Pick the right model or tool. A router in your app sends each job to the cheapest thing that does it well: a reasoning model for multistep problems, a small language model for high-volume labelling, a multimodal model for photos, and a Foundry Tool such as Content Understanding for invoices.
- Where an agent gets its facts. Curated company content lives in a Foundry IQ knowledge base on Azure AI Search. Files a user drops into the chat go to file search. What the agent learns about the user across sessions goes to memory (user profile, chat summary).
- Resource, projects and deployment types. One Foundry resource holds deployments, networking and keys. Projects inside it isolate teams. Global deployments may process anywhere, Data Zone stays in the EU or US zone, Standard stays in one region. The standard agent setup keeps threads, files and vectors in your own Cosmos DB, Storage and AI Search.
- Configure deployments and agent versions. A deployment pins a model, a model version, a deployment type, capacity (TPM) and a guardrail. An agent gets a new version every time you change it; the endpoint serves the version you choose, so you can roll back.
- CI/CD with an evaluation gate. The agent definition, prompts and Bicep live in Git. The pipeline signs in with workload identity federation (no secret), runs an evaluation on a test set, and only then promotes from dev to test to prod projects.
- Quotas, 429s, spillover and budgets. Quota is tokens per minute per model, per region, per deployment type. Each deployment gets a slice; RPM comes with it. Go over and you get HTTP 429 with a retry-after header. Provisioned throughput can spill over to a standard deployment, and a cost control can stop a project at its token budget.
- Monitor models, agents and search. Azure Monitor metrics show requests, tokens, latency and errors. Application Insights holds traces, and continuous evaluation scores a sample of live answers for groundedness and safety. For Azure AI Search, watch indexer runs, document counts, search latency and throttled queries.
- Keyless and private. The app uses a managed identity and Microsoft Entra ID tokens, with the Foundry User role on the resource. Local (key) auth is turned off. Public network access is disabled and a private endpoint in your VNet is the only way in.
- Guardrails at four intervention points. A guardrail is a set of controls: a risk (hate, violence, prompt attacks, indirect attacks, protected material, PII), the intervention point (user input, tool call, tool response, output) and the action (annotate, or annotate and block).
- Evaluate, red team and trace. Evaluators score answers: groundedness, relevance, coherence, safety, and agent ones like tool call accuracy and task adherence. The AI red teaming agent attacks before launch. Traces in Application Insights record every model call, tool call and approval for audit.
- Govern what the agent may do. Give the agent only the tools it needs (allowed tools), make risky tools require approval from a human, let the tool call guardrail check what it sends, and limit where a hosted agent can connect with network egress controls.
Contoso's data must stay in the EU. Create the Foundry resource, deploy with a Data Zone deployment type, pin the version and capacity, then publish a new agent version and roll it back.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 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
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:
| Setting | What it controls |
|---|---|
| Deployment name | The name your code calls. Keep it stable and descriptive. |
| Model version | The exact release. Pick one when behaviour must not change. |
| Deployment type | Global, Data Zone, Standard, Provisioned or Batch. |
| Tokens per minute (capacity) | The slice of quota this deployment gets, with matching requests per minute. |
| Version upgrade policy | No auto upgrade, upgrade when a new default arrives, or upgrade only near retirement. |
| Guardrail | The 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:
- Create the new version in a dev project and run your evaluation set.
- Promote the same definition to the next environment.
- Watch metrics and continuous evaluation after release.
- 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
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.
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.
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.What do you call from code, the deployment name or the model name?Show
The deployment name.
-
2.What creates a new agent version?Show
Any change to its model, instructions or tools.
-
3.How do you roll back an agent?Show
Point the endpoint at the earlier version.
-
4.Where does a deployment's capacity come from?Show
The quota for that model and deployment type.
-
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
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.