AI-901
Deep Dive
This is the skill with the most exam questions: "Implement generative AI apps and agents by using Foundry". It covers everything from designing a prompt to deploying a complete agent — all within the same portal and SDK.
Contents
An effective prompt separates two clear roles. The exam expects you to recognize which is which.
System prompt
Sets the role, tone, and rules the model must follow throughout the entire conversation. Configured once per deployment or agent.
E.g.: "You are a technical support assistant. Only answer about company products. If you don't know the answer, say so."
User prompt
The user's specific request at each turn of the conversation. It changes with every interaction.
E.g.: "How do I restart my router?"
Prompt best practices
Be specific about the expected output format, give examples (few-shot) when the task is ambiguous, and use the system prompt for scope boundaries — not for complex business logic.
The simplest flow in Microsoft Foundry requires no code: choose a model from the catalog, deploy it, and test it directly in the portal.
Create or open a project in the Foundry portal (ai.azure.com).
Choose a model from the model catalog and deploy it (deployment).
Open the Playground and interact with the model using test prompts.
Adjust the system prompt and parameters (temperature, max tokens) until you get the expected behavior.
The Foundry SDK is a thin client that exposes all of the project's APIs through a single endpoint. Higher-level SDKs — like Agent Framework — are built on top of the Foundry SDK, not as a replacement for it.
A lightweight chat client built with the Foundry SDK follows this pattern, at a high level:
// Pseudocode — general Foundry SDK pattern
client = FoundryProjectClient(endpoint, credential)
chat = client.get_chat_client(deployment_name)
response = chat.complete(messages=[system_prompt, user_prompt])
The exam doesn't test exact code syntax — it tests whether you recognize the pattern: a project endpoint, a deployment, and a chat/completion call.
Microsoft Foundry offers two ways to build an agent. The exam clearly distinguishes between the two.
Portal Agents
Hosted Agents
Exam key point
If the scenario says "no infrastructure to manage" or "built in the portal" → Portal Agent. If it says "own code packaged" or "agent framework" → Hosted Agent.
Once the agent exists (Portal Agent or Hosted Agent), a lightweight app can consume it by calling its endpoint through the Foundry SDK — the same client pattern changes little, regardless of whether the agent runs code-free or with your own code behind it.
❓ Does a Portal Agent require you to manage compute?
No. Foundry runs it directly — that's the key difference from a Hosted Agent, which does run on an endpoint managed by your own container.
❓ Does the Foundry SDK replace frameworks like Agent Framework?
No. The Foundry SDK is the base layer (thin client, a single project endpoint). Higher-level frameworks are built on top of it to provide additional orchestration capabilities.
❓ Does the system prompt change with every user message?
No. The system prompt is configured once to set the role and rules. The user prompt is what changes with every turn of the conversation.
Did you get this topic?
Test what you just learned
A team wants to launch a single-purpose support agent as soon as possible, without spending time managing infrastructure or containers. Which Microsoft Foundry approach fits best?
Put what you learned to the test with original AI-901 exam questions.
Start AI-901 mock examUnlimited mock exams with the Pro plan
Log in to track your progress.