Deploy a Model and Chat in the Foundry Portal
30-second answer
To use a model in Microsoft Foundry, you deploy it first: pick it in the model catalog, select Deploy, give it a deployment name and choose a deployment type such as Global Standard. Then open the chat playground, add a system message, ask questions and adjust parameters like temperature and max tokens. When it behaves the way you want, View code shows ready-to-run code that calls your deployment by name.
Simulate it » No Azure account neededExam objective: 2.1.2 Deploy a model and interact with it in the Foundry portal. (Skills measured as of April 15, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Open <strong>Models + endpoints</strong> and select <strong>+ Deploy model</strong> ➜ *Deploy base model* ➜ <strong>gpt-4.1-mini</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open Models + endpoints and select + Deploy model ➜ Deploy base model ➜ gpt-4.1-mini.
- Choose the deployment name and deployment type.
- The deployment is Succeeded. It has its own endpoint, rate limit and guardrail.
- Select Open in playground. The system message sets the rules; parameters tune the answers.
- Select View code to get the same call in Python, ready for your app.
🧪 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
Deploy a model
Before an app can call a model you deploy it and give the deployment a name. Global Standard (pay per token, the default), Data Zone (keeps processing in the US or EU), Provisioned (reserved throughput) and Batch (cheaper, within 24 hours) trade price, speed and data location.
🤔 What happens if…
Read this tour as text
- Resource and project. A Foundry resource is the Azure resource that holds your models, tools, security and billing. Inside it, a project is the workspace where a team builds one app: its deployments, agents, files and evaluations.
- The model catalog. The model catalog lists thousands of models: OpenAI GPT models, Microsoft Phi, Meta Llama, Mistral, DeepSeek and more. Each has a model card, benchmarks and the deployment types it supports.
- Deploy a model. Before an app can call a model you deploy it and give the deployment a name. Global Standard (pay per token, the default), Data Zone (keeps processing in the US or EU), Provisioned (reserved throughput) and Batch (cheaper, within 24 hours) trade price, speed and data location.
- Test in the playground. The chat playground lets you try a deployment with no code. The system message sets the rules, the user message asks the question, and parameters such as temperature tune the answer.
- Call it from your app. Your Python app uses the Foundry SDK (
azure-ai-projects): connect to the project endpoint with Microsoft Entra ID, get an OpenAI-compatible client and call the deployment by its name. - An agent: model + instructions + tools. An agent is a model with instructions and tools that can decide what to do next. Foundry Agent Service keeps the conversation and runs the tools for you.
- Tools in action. Ask "What is our refund limit, and what is 15% of ₹4,200?" The agent uses file search for the policy and the code interpreter for the maths, then answers in one reply. That loop of plan, act and observe is what makes it agentic.
- Guardrails and monitoring. Every request passes guardrails (content filters) on the way in and out. Tracing and evaluations show what the agent did, how long it took and whether answers are grounded and safe.
Deploy a GPT model, chat with it in the playground, then turn the temperature and max-tokens dials and watch what changes.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
You want to try a model today, not after a week of coding.
😊 THE SOLUTION
Deploy it in the portal and chat with it in the playground.
- Long setup✓ Deploy in a few clicks
- Unsure how it behaves✓ Test in the chat playground
- Need code next✓ View code
Start with a question
You found the perfect model in the catalog. Why can't you just start chatting with it?
Picture a car showroom in Hyderabad. You can look at every model on the floor, read the spec sheet and compare mileage, but you can’t drive any of them home until one is registered in your name with a number plate.
Deploying a model in Foundry is that registration. The model gets a deployment name (your number plate) inside your resource, and from then on the playground and your app can use it.
Explain it like I’m 10
The technical explanation
-
1 Pick a model
Open the model catalog and choose one, for example gpt-4.1-mini.
-
2 Deploy
Set the deployment name and deployment type (Global Standard by default).
-
3 Chat
Open the playground, write a system message and ask questions.
-
4 Tune
Change temperature, max tokens and other parameters.
-
5 View code
Copy sample code that calls your deployment by name.
The deploy step
When you select Deploy on a model, Foundry asks for:
- Deployment name: anything you like, such as
gpt-4.1-miniorsupport-bot. Your code will pass this exact name asmodel. - Deployment type: where requests are processed and how you pay.
- Rate limit (tokens per minute) from your quota, plus the guardrail (content filter) to apply.
| Deployment type | What it means | Pick it when |
|---|---|---|
| Global Standard | Pay per token; requests can be processed in any region | You’re starting out, or want the newest models |
| Data Zone Standard | Processing stays inside the US, EU or APAC data zone | Data must stay in a zone |
| Standard | Processing in the resource’s own geography | Strict regional processing |
| Provisioned (global, data zone or regional) | Reserved capacity in provisioned throughput units | Steady, high volume with predictable latency |
| Global Batch | Upload a file of requests, results within 24 hours, about half the price | Large jobs that aren’t urgent |
Data stored at rest stays in your resource’s geography for every type.
The chat playground
The playground has a system message box, a chat window and a parameters panel:
| Parameter | What it does |
|---|---|
| Temperature (0 to 2) | Lower is focused and repeatable, higher is more varied and creative |
| Top P | Another way to control variety. Change this or temperature, not both |
| Max output tokens | Caps the length of each reply |
| Stop sequences | Text that makes the model stop generating |
| Frequency and presence penalty | Discourage repeating the same words or topics |
| Past messages included | How much chat history is sent with each new question |
Reasoning models show a reasoning effort setting instead of temperature.
When you’re happy, select View code. It shows sample code (Python and other languages) with your endpoint, deployment name, system message and parameters already filled in, so the app behaves the same as the playground.
Architect level Quota, rate limits and instant access
Each subscription has a quota of tokens per minute per model and region. When you deploy, you assign part of that quota to the deployment, and requests over the limit get HTTP 429 errors. Some models in preview offer instant access, where you can call them by name without creating a deployment, but for the exam assume the deploy-then-call flow. Open models can also run on managed compute, where you pay per hour for the VMs instead of per token.
Real-world business scenario
Wide World Importers (fictional)
- The problem
- Product managers wanted to test AI-written product descriptions before asking developers to build anything.
- What they used
- A gpt-4.1-mini deployment on Global Standard named product-writer, tested in the chat playground with a system message, temperature 0.7 and a 150-token limit.
- Why that choice
- The playground let non-developers tune the tone and length themselves, and View code handed developers the exact settings.
- The result
- The first app version matched what the product team had approved in the playground, with no back-and-forth on settings.
When to use it and when not to
✓ Use it when…
- You want to try a model and prompts before writing an app.
- You need to compare settings like temperature side by side.
- You want sample code that matches a tested setup.
✕ Think twice when…
- Running production traffic through the playground. It's a test tool; call the deployment from your app.
- Picking a provisioned deployment before you know your traffic. Start with Global Standard.
↔ Alternatives to consider
- The Foundry SDK to call your deployment from code once you know what works.
- The agent playground when you need tools like file search or web search.
Test yourself with exercises
5 original practice questions in the AI-901 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 do you have to deploy a model before you can use it?
Model answer
The catalog is just a list. Deploying creates an endpoint for that model in my Foundry resource with a name, a deployment type and limits, so my project can actually send it requests and I get billed for what I use.
Interviewer follows up
What do you pass as the model name in code?
You
The deployment name, not the catalog name. If I deployed gpt-4.1-mini as "support-bot", my code uses "support-bot".
Intermediate What would you change in the playground to make answers more consistent?
Model answer
I'd lower the temperature, say to 0.2, and tighten the system message. If answers are being cut off I'd raise max output tokens. I'd change temperature or top_p, not both at once, so I know which one made the difference.
Experienced developer Which deployment type would you start with, and when would you change it?
Model answer
Global Standard is the usual start: pay per token, highest default quota and new models first. If data must be processed inside the EU or US, I'd move to Data Zone Standard. For steady, high-volume traffic where latency must be predictable I'd look at provisioned throughput, and for big offline jobs, Global Batch is about half the price.
Scenario A tester says the playground gives good answers, but the developer's app doesn't. What would you check first?
Model answer
That the app uses the same deployment name, the same system message and the same parameters. Using View code from the playground is the quickest way to make them match.
Quick revision
Key points
- You must deploy a model before the playground or an app can call it.
- The deployment name you choose is what code passes as model.
- Global Standard is the default deployment type, billed per token.
- The chat playground lets you set a system message and tune temperature, top_p and max tokens.
- View code copies working code for the current setup.
Important terminology
- Deployment
- A hosted instance of a model in your Foundry resource that your apps and the playground can call.
- Deployment name
- The name you give a deployment. Code passes this name as the model parameter.
- Global Standard
- The default deployment type. You pay per token and requests may be processed in any Azure region.
- Chat playground
- A page in the Foundry portal where you chat with a deployment, edit the system message and change parameters without writing code.
- Temperature
- A parameter from 0 to 2 that controls randomness. Low values give focused, repeatable answers; high values give more varied ones.
- Max output tokens
- The upper limit on how many tokens the model can generate in one reply.
- View code
- The playground button that shows sample code for the current deployment, system message and parameters.
Common mistakes
- Using the catalog model name in code when the deployment has a different name.
- Changing temperature and top_p together, then not knowing which caused the change.
Exam tips
- "Test prompts and parameters without writing code" = chat playground.
- "More predictable, less creative answers" = lower temperature.
- "Answers are cut off mid-sentence" = raise max output tokens.
Five quick revision questions
-
1.What's the default deployment type for most models?Show
Global Standard.
-
2.Which name does your code use to call a model?Show
The deployment name.
-
3.What does a low temperature do?Show
Makes answers more focused and repeatable.
-
4.Where do you get sample code for your playground setup?Show
The View code button in the playground.
-
5.What limits the length of a reply?Show
Max output tokens.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Build a Chat App with the Foundry SDK
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.