Lesson 3 of 4 Foundry Infrastructure and Deployments

Configuring Model Deployments and Agent Versions

This lesson explains how to configure the model version, capacity and safety settings of a deployment and, for agents, the definition and version, and how applications refer to deployments so that changes do not require code changes.

Learning outcomes

After completing this lesson, you will be able to:

  • Configure a model deployment's name, version, upgrade policy and capacity.
  • Explain why deployment names are an abstraction over models.
  • Create agent versions with project.agents.create_version().
  • Plan a model version upgrade without disruption.

Model deployment settings

A model deployment makes one version of a catalogue model available for requests in a Foundry resource, under a name that applications use to call it. Its configuration decides which model answers, how much traffic it can take and which safety controls apply. A deployment is created in the Foundry portal, with the Azure CLI, or with infrastructure as code (IaC). Its settings are the deployment name, the model and version, the version upgrade policy, the deployment type, the capacity (TPM for standard types, PTUs for provisioned) and the guardrail. The following command creates a Global Standard deployment with 50,000 tokens per minute (capacity is expressed in thousands of TPM).

az cognitiveservices account deployment create \
  --name my-foundry --resource-group rg-ai \
  --deployment-name chat-primary \
  --model-name gpt-5-mini --model-version 2025-08-07 --model-format OpenAI \
  --sku-name GlobalStandard --sku-capacity 50

The upgrade policy either moves the deployment to the new default version automatically or keeps it on the pinned version until that version retires. Production workloads that are sensitive to output changes pin versions and test new versions in a separate deployment first. Model retirement dates are published, and deployments on a retiring version must be upgraded before that date.

The following screenshot shows these settings in the Foundry portal's deployment pane: a deployment name chosen by purpose (chat-primary), the deployment type, the model version and its version upgrade policy, the tokens-per-minute rate limit and the guardrail.

Deploy gpt-5.4-mini pane with deployment name chat-primary, Global Standard, model version, upgrade policy, tokens-per-minute rate limit and the DefaultV2 guardrail
The upgrade policy shown moves the deployment to each new default version; pinning a version keeps it until its retirement date.
Fill in the value

Deployment capacity

Exam skills 1.2.3 · 1.3.1

Convert deployment capacity values into tokens per minute.

Log in to try this activity Interactive activities are free with an account.

Deployment names as an abstraction

Applications pass the deployment name in the model parameter. Naming deployments by purpose, such as chat-primary or classifier, rather than by model, allows the team to deploy a new model under a new name, test it, and then switch configuration or recreate the purpose-named deployment, without changing application code. Model router is a special deployment that chooses among several underlying models per request.

The abstraction pays off whenever the model behind a purpose changes. Suppose an application calls classifier in six services. If the code had used the model name directly, moving to a newer model would require changing and redeploying all six. With a purpose name, the change is made once, in the deployment or in a configuration value, and can be reversed just as quickly if evaluation reveals a problem. The deployment name also carries the capacity, deployment type and guardrail settings, so they move with it rather than being scattered through application code.

The following diagram shows how a stable deployment name lets the model version change without any change to the application.

A deployment name as a stable abstraction. The application calls a deployment by name, such as summarizer, on a pinned model version. A parallel deployment on the new version is scored against the same evaluation dataset, and the original deployment is then updated to the new version, so the application code is unchanged.
The application always calls the summarizer deployment by name. Only the model version behind that name changes, after a parallel deployment has been evaluated.

Agent definitions and versions

An agent in Foundry Agent Service is created with project.agents.create_version(). Each call with the same agent name creates a new, immutable version that records the model deployment, instructions, tools and tool configuration. Applications obtain an OpenAI client bound to the agent with project.get_openai_client(agent_name=...), or pass an agent reference in each request, and call it through the Responses API.

from azure.ai.projects.models import PromptAgentDefinition

agent = project.agents.create_version(
    agent_name="support-agent",
    definition=PromptAgentDefinition(
        model="chat-primary",
        instructions="You answer questions about Contoso orders. Use the order tool for order status.",
        tools=[order_tool],
    ),
)
print(agent.name, agent.version)

Versioning supports safe change: a new version is evaluated in a test project or with a test dataset, then promoted, and the earlier version remains available for rollback. Agents can be assigned their own guardrail, which overrides the model deployment's guardrail.

Saving an agent in the Foundry portal also creates a new version. The following screenshot shows the version list of an agent after its tools were changed: version 2 is active, and version 1 remains available for comparison.

Agent version list showing version 2 as active and version 1, with Compare versions and Show all version history options
Each saved change creates an immutable version, so the previous definition can be compared or restored.
True or false

Agent versions

Exam skills 1.2.3 · 2.2.1

Check four facts about agent definitions and versions.

Log in to try this activity Interactive activities are free with an account.
Worked example

Upgrading without disruption

A company's application uses a deployment named summarizer on a pinned model version that retires in three months. The team must validate the new version and switch without redeploying the application.

The team creates a second deployment, summarizer-next, on the new version, runs its evaluation dataset against both, and, when the scores are acceptable, updates the summarizer deployment to the new model version. The application keeps calling summarizer. Enabling automatic upgrade on the production deployment without testing would meet the deadline but risk unvalidated output changes.

Check yourself

Why should applications refer to deployment names rather than model names?

Show answer

A deployment name, chosen by purpose, stays the same when the model or version behind it changes, so models can be upgraded without changing application code.

Exam Tips

Remember for the exam

  • Applications refer to deployment names; name deployments by purpose.
  • Pin versions for stable output; test new versions in a parallel deployment before switching.
  • Each create_version call creates an immutable agent version; roll back by using the previous version.