Course menuAI-901

Exams / AI-901 / Study guide / Prompts and deploying a model in the Foundry portal

Prompts and deploying a model in the Foundry portal: AI-901 study notes and practice questions

What to know about Prompts and deploying a model in the Foundry portal for the AI-901 exam, from the Implement AI solutions by using Microsoft Foundry domain (58% of the exam guide), then 5 free questions to test it. Part of the AI-901 study guide.

Last verified against current Microsoft Learn ·How we write our questions

What to know for the exam

Domain 2 starts in the portal at ai.azure.com. The exam checks that you know the steps and the vocabulary, not the exact button positions.

The portal workflow

  1. Sign in and create a Foundry project. The current model is a single Foundry resource with projects, which replaces the older hub-based projects.
  2. Open the model catalog, pick a model and choose Deploy. Default settings are usually fine. The deployment name is what your code later refers to.
  3. The playground opens. Chat with the model, and use New chat to clear history.
  4. Put behavior rules in Instructions, which is the system prompt. For example, limit the model to the history of computing.
  5. Add tools such as web search, or choose Save as agent. Continue in code shows client code, and the Monitor and Cost tabs show usage and token cost.
  6. Clean up by deleting the Azure resource group so it stops costing money.

Prompt roles

Role Purpose
System Instructions: role, scope, constraints, output format
User The request
Assistant Earlier replies, or example answers for few-shot prompting

Prompt techniques

Put clear instructions first. Give few-shot examples (zero-shot means none). Specify the output format. Break a task into steps. Supply grounding context and give the model an “out”, such as “say not found if the answer is not in the text”. Use clear separators between instructions and data. Repeating a key instruction can help. Chain-of-thought prompting is not recommended for reasoning models.

How to choose

  • Change the model’s behavior or scope points to the Instructions box.
  • Show the model an example of the format points to few-shot prompting.
  • Reduce made-up answers points to grounding context with an out.

Common traps

  • Putting the rules in the user message. Behavior rules belong in the system prompt.
  • Zero-shot versus few-shot. Few-shot includes examples.
  • Forgetting cleanup. Resources keep billing until deleted.

Try the 5 practice questions

An online furniture retailer is building a chat assistant for delivery and return questions. The team wants it to stay on topic, quote only store policies and keep a friendly tone.

In the Foundry playground, a developer wants these standing rules to shape every reply in the session.

Where should the rules be entered?

Choose one answer.

  1. A. The chat message box, where each shopper's question is typed as the request
  2. B. The Instructions box, which holds the system prompt that guides every reply
  3. C. The Tools panel, where a web search tool is added to the playground
  4. D. The Monitor tab, which shows token usage and response times for the model
Show the answer and explanation

Answer: B

  • A. Wrong: The chat box holds user prompts, which carry each individual request. Those requests change with every message, so they cannot set standing rules for the whole session.
  • B. Right: Correct. The Instructions box holds the system prompt, which sets the role, scope and tone of the assistant. The playground applies it to every reply in the session.
  • C. Wrong: The Tools panel adds capabilities such as web search. It does not set the assistant's rules, so the store's policies would not shape each reply.
  • D. Wrong: The Monitor tab reports usage and performance for the deployed model. It helps check cost and latency, but it does not store behavior rules.

Explanation

A system prompt sets standing behavior such as role, scope and tone, and the playground enters it in the Instructions box. A user prompt carries each shopper's question. Tools and Monitor help with capabilities and measurement, not behavior rules.

Study

A garden-supply retailer's chat assistant answers plant-care questions, but its replies vary in tone and length.

The developer wants to show the model two sample exchanges before each real question: a sample customer question followed by an ideal reply in the house style.

Which message role should carry the ideal sample replies?

Choose one answer.

  1. A. The system role, which holds the standing instructions for the whole conversation
  2. B. The user role, which carries the customer's request that the model must answer
  3. C. The assistant role, which holds earlier model replies and few-shot example answers
  4. D. The tool role, which returns results from a function the model called earlier
Show the answer and explanation

Answer: C

  • A. Wrong: The system message sets the assistant's role, rules and tone for every reply. It could describe the house style, but sample replies placed in a conversation are normally written as assistant messages.
  • B. Wrong: User messages hold the requests, so they suit the sample customer questions. Putting the ideal replies in user messages would make them look like more questions rather than examples of answers.
  • C. Right: Correct. Assistant messages represent the model's own replies, so a sample question in a user message followed by an ideal answer in an assistant message forms a few-shot example. The model then copies that tone and length. Learn more: Prompt engineering techniques (opens in a new tab)
  • D. Wrong: Tool messages carry the output of a function or tool call back to the model. They are not used for examples of how the assistant should reply.

Explanation

Few-shot prompting shows the model example exchanges before the real request. The sample questions go in user messages and the ideal replies go in assistant messages, while the system message holds standing instructions. Tool messages return function results and play no part in examples.

Study

A university's IT office is preparing a chat model for a writing tutor that students will use in the browser. The team is reading the playground and prompt engineering documentation before running its first tests.

Which of these statements about the playground and prompting are true?

For each statement, choose Yes if the statement is true. Otherwise, choose No.

  1. A. The playground's Tools section can add a web search tool for live web results.
  2. B. Few-shot prompting means sending the model no examples at all, relying only on its training.
  3. C. Telling the model to reply 'not found' when the answer is missing from the notes is a grounding technique.
Show the answer and explanation
  • A. Yes. Yes. The playground lets you add tools such as web search from the Tools section, so the model can use current web results in its replies.
  • B. No. No. Few-shot prompting includes example input and output pairs in the prompt. Sending no examples at all is zero-shot prompting.
  • C. Yes. Yes. Giving the model an 'out' such as 'say not found' keeps it from inventing answers that the supplied material does not support.

Explanation

Adding a web search tool is a playground feature, and an explicit 'not found' instruction is a grounding technique. Few-shot prompting uses examples, while zero-shot prompting uses none.

Study

An online pet-supply retailer uses a chat model to draft product descriptions. The marketing lead wants each description to read almost the same every time it is regenerated.

Every description must still be complete sentences, not cut off partway through. The model accepts temperature and top_p settings.

Which change best meets these requirements?

Choose one answer.

  1. A. Raise the temperature to about 1.2 and leave top_p at its default value
  2. B. Lower the temperature to about 0.2 and leave top_p at its default value
  3. C. Lower max tokens to 40 so each description is short and always identical
  4. D. Turn on web search so each draft is checked against the latest product pages
Show the answer and explanation

Answer: B

  • A. Wrong: A higher temperature increases randomness, so each regenerated description would vary more, not less. It moves the wording in the opposite direction from what the marketing lead wants.
  • B. Right: Correct. A low temperature makes the model favor its most likely words, which gives focused and repeatable wording. Adjusting one setting at a time keeps the result predictable.
  • C. Wrong: Max tokens only caps the response length, so long descriptions would be cut off mid-sentence. It does not make the wording repeat.
  • D. Wrong: Web search brings in outside pages, which changes the content of each draft. It does not control how predictably the model chooses its words.

Explanation

Repeatable wording comes mainly from the sampling settings, and a lower temperature is the setting to change. Microsoft's guidance is to change temperature or top_p, not both. Max tokens only truncates output, which would cut descriptions off.

Study

Question 5

Harder · choose 2 ·Link to this question (question 5)

A dental clinic network has tested a booking-help chat model in the Foundry playground and has just edited its Instructions.

The developer wants to retest the new Instructions without earlier messages affecting the replies. The developer also wants starter Python code that calls the same deployment.

Which two playground actions should the developer use? (Choose two.)

Choose two answers.

  1. A. Open the Cost tab to review token usage for the earlier test conversations
  2. B. Select New chat, which clears the conversation history before the next test
  3. C. Raise max tokens so that longer earlier replies stay out of the next answer
  4. D. Select Continue in code, which shows client code for calling the deployment
  5. E. Add a web search tool so the model checks new facts before each reply
Show the answer and explanation

Answers: B, D

  • A. Wrong: The Cost tab shows token usage and spending. It helps track cost but neither clears the conversation nor produces client code.
  • B. Right: Correct. New chat starts a fresh conversation, so earlier messages no longer influence the replies. The developer can then see how the edited Instructions behave on their own. Learn more: Lab: Generative AI and agents (opens in a new tab)
  • C. Wrong: Max tokens caps the length of each response. It does not remove earlier messages from the conversation or generate any code.
  • D. Right: Correct. The Continue in code option shows sample client code for the model the developer has been testing. It gives a starting point for the Python app. Learn more: Lab: Generative AI and agents (opens in a new tab)
  • E. Wrong: Web search lets the model use current web results. It does not clear the earlier conversation or give the developer starter code.

Explanation

New chat clears the conversation history, so a retest reflects only the edited Instructions. Continue in code shows client code for the tested deployment, which gives the developer a starting point. Cost, max tokens and web search each serve a different purpose.

Study

Want more on Prompts and deploying a model in the Foundry portal? The 5 full-length practice sets have 25 more Prompts and deploying a model in the Foundry portal questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets

Study Prompts and deploying a model in the Foundry portal

More Implement AI solutions by using Microsoft Foundry topics

Every exam starts with free questions. No account needed.