Skip to content
Microsoft Azure AI Fundamentals (AI-901) Exam Prep

Lesson 3 of 5 · 17 min

x
3/5

Domain 2: Implement AI Solutions by Using Microsoft Foundry (Part 1 of 3)

This lesson covers 5 exam topics: Microsoft Foundry Essentials, Writing System and User Prompts, Deploying and Testing a Model in the Portal, Building a Chat Client with the Foundry SDK, Creating a Single Agent in the Portal. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.

1. Microsoft Foundry Essentials

Video lesson: AI-901 11/25: Microsoft Foundry Essentials

Central question: What is Microsoft Foundry, and which surface do you use for what?

What Foundry is

  • Unifies agents, models and tools under one management grouping, with tracing, monitoring, evaluations, and unified RBAC, networking and policies under one Azure resource provider.
  • Models: 10,000+ models in the Foundry Models catalog. Agents: Foundry Agent Service. Tools and knowledge: built-in tools, memory, retrieval.
  • Foundry Tools include Azure Language, Azure Speech, Azure Vision and Azure Content Understanding, available through a Foundry resource.
  • A Foundry resource with projects; your code connects through a project endpoint (format https://<resource>.services.ai.azure.com/api/projects/<project>).

Developer surfaces

SurfaceBest for
Foundry portalExploring models, prototyping prompts in playgrounds, building prompt agents without code
SDKs (Python, C#, JavaScript, Java)Building applications
Azure Developer CLI (azd)Scaffolding and deploying hosted agent projects
Visual Studio CodeBuilding and debugging agents in the editor

Hub-based projects remain in the Foundry (classic) portal; new investment is in Foundry projects (verified).

Exam traps

  • Separate keys and endpoints for every capability. One project endpoint gives access to project APIs.
  • Code required for prototyping. Playgrounds and prompt agents need none.
  • Confusing the Foundry resource and a project. Projects live in a Foundry resource.

2. Writing System and User Prompts

Video lesson: AI-901 12/25: Writing System and User Prompts

Central question: How do you write prompts that produce reliable output?

Two kinds of message

  • System message: instructions that set the model's role, rules, tone and output format for the whole conversation.
  • User prompt: the request or data for this turn.
  • Few-shot examples: example user and assistant pairs after the system message; they condition the model for the current inference only. Prompts without examples are zero-shot.

Techniques (verified where noted; others general background)

TechniqueExample
Clear instructions and role"You are a support agent for Contoso. Answer only about our products."
Specify output format"Return JSON with fields: issue, urgency."
Few-shot examples (verified)Two sample ticket→category pairs
Ground in dataPaste or retrieve the relevant document; "answer only from the text below"
Break tasks into stepsExtract facts first, then write the answer
Set boundariesWhat to do when the answer isn't known

Microsoft notes you must still validate responses: a prompt that works for one scenario may not generalize (verified).

Exam traps

  • Putting role and rules in every user message instead of the system message.
  • Believing few-shot changes the model permanently.
  • No instruction for unknown answers, inviting hallucinations.

3. Deploying and Testing a Model in the Portal

Video lesson: AI-901 13/25: Deploying and Testing a Model in the Portal

Central question: How do you deploy a model in Foundry and try it out?

Steps (portal flow; general background built on verified features)

  1. Open your project in the Foundry portal.
  2. Browse the model catalog; compare capabilities, cost and region support.
  3. Deploy the model: choose a deployment name and deployment type (start with Global Standard) (lesson 05).
  4. Open the playground: set the system message, adjust parameters (temperature, max tokens), and chat.
  5. Use View code to copy sample code for your app.

Facts to know

  • Instant access (preview) lets you call some models by name without creating a deployment.
  • Not all models support all deployment types; check availability by region.
  • In code, you reference the deployment name (or model name for instant access).

Exam traps

  • Calling a model by its catalog name when your code needs your deployment name.
  • Testing only one prompt. Try several realistic prompts before building.
  • Provisioned deployment for a prototype.

4. Building a Chat Client with the Foundry SDK

Video lesson: AI-901 14/25: Building a Chat Client with the Foundry SDK

Central question: What is the minimum code to chat with a Foundry model?

Verified Python pattern

1# pip install "azure-ai-projects>=2.3.0"2from azure.identity import DefaultAzureCredential3from azure.ai.projects import AIProjectClient4 5project = AIProjectClient(endpoint=PROJECT_ENDPOINT, credential=DefaultAzureCredential())6openai = project.get_openai_client()7response = openai.responses.create(model=DEPLOYMENT_NAME, input="Summarize our refund policy.")8print(response.output_text)
PieceRole
azure-ai-projects (Foundry SDK)Thin client to all project APIs through one project endpoint
DefaultAzureCredentialMicrosoft Entra ID sign-in (no keys in code)
get_openai_client()OpenAI-compatible client bound to the project
responses.createCalls the model (Responses API)

Making it a chat client (general background)

Loop: read user input → send it (with history or a conversation) → print the reply. Add a system instruction for role and rules.

Exam traps

  • Hard-coding API keys. Prefer Entra ID with DefaultAzureCredential.
  • Wrong endpoint. Use the project endpoint, not a random service URL.
  • Forgetting history. Without it, each turn is independent.

5. Creating a Single Agent in the Portal

Video lesson: AI-901 15/25: Creating a Single Agent in the Portal

Central question: How do you build and test one agent in Foundry without code?

Foundry Agent Service

  • An agent is a model + instructions + tools that reasons over requests and takes action.
  • Prompt agents: defined entirely by configuration (instructions, model, tools); Foundry runs them with no code or containers. Fastest path.
  • Other types: voice-based prompt agents (via Voice Live) and hosted agents (your own code as a container).
  • Toolboxes: web search, file search, code interpreter, MCP servers, custom functions.
  • Portal-first path: create the agent, test it in the playground, then call it from code.

Steps (general background on verified features)

  1. Create an agent in the project; name it.
  2. Pick a deployed model.
  3. Write instructions (role, scope, tone, what to refuse).
  4. Add tools/knowledge (e.g. file search over uploaded documents).
  5. Test in the playground; refine instructions; save a version.

Exam traps

  • Hosted agent for a simple FAQ agent. A prompt agent needs no code.
  • No knowledge attached, then expecting company-specific answers.
  • Skipping playground testing.

References

  1. AI-901 study guide — checked Oct 21, 2026
  2. What is Microsoft Foundry — checked Oct 21, 2026
  3. Foundry SDKs and endpoints — checked Oct 21, 2026
  4. Prompt engineering techniques — checked Oct 21, 2026
  5. Deployment types — checked Oct 21, 2026
  6. Get started with code — checked Oct 21, 2026
  7. Agents in Foundry — checked Oct 21, 2026

Check your understanding

  • Try prompts against a model without writing code?Show answer

    Answer

    Foundry portal playground.
  • Where do persistent rules go?Show answer

    Answer

    The system message.
  • Where do you experiment with prompts and parameters?Show answer

    Answer

    The playground.
  • Package for the Foundry SDK in Python?Show answer

    Answer

    azure-ai-projects.
  • Agent type with no code or infrastructure?Show answer

    Answer

    Prompt agent.
Previous

Progress is saved in this browser.

Next Lesson