AI-102 · Domain 2 of 6

AI-102 Domain 2: Implement generative AI solutions

Building, grounding, evaluating and tuning generative AI apps in Microsoft Foundry and Azure OpenAI. The exam tests whether you pick the right technique, parameter or deployment for the problem described, not whether you can write clever prompts.

Exam weight
15-20%
Official skill groups
3
Estimated questions estimate
6–12
Suggested study time estimate
15–20 hrs

About 17 min read Reviewed October 2026

Overview

This skill area covers the build and run phases of a generative AI app. On the build side you create a Foundry hub or project, deploy a model, use prompt templates and prompt flow, ground the model in your own data with retrieval augmented generation (RAG), evaluate quality and safety, and call everything from code through the Foundry SDK or the Azure OpenAI client. It also covers image generation with DALL-E and multimodal models that accept images alongside text.

The run side is about control and improvement: sampling parameters, monitoring token use and latency, scaling and model version updates, tracing with feedback collection, model reflection, orchestrating several models, prompt engineering, and fine-tuning. The skill being tested is diagnosis: given a symptom such as wrong facts, wrong format, high cost or slow responses, choose the change that fixes that symptom.

How it's tested

Expect scenario questions that describe a symptom or goal and ask for the BEST technique, plus code completions with the chat completions API, parameter values, and the order of steps to build a RAG or prompt flow solution. Case studies often include cost or freshness constraints that rule out the most powerful-sounding option.

  • Symptom to technique

    A model gives outdated facts, ignores a format, or varies too much, and you choose RAG, fine-tuning, prompt engineering or a parameter change. The symptom decides the technique.

  • API and parameter completion

    A code fragment sends messages to a chat model and you fill in the role, parameter or value. Know system, user and assistant roles, temperature, top_p, max_tokens and stop.

  • Evaluate and operate

    You choose an evaluation metric, a monitoring setting, or a tracing approach to explain or measure behavior after deployment.

Reasoning it through

A support bot answers from product manuals that change weekly, and answers cite discontinued features. Fine-tuning would bake in this week's facts and need retraining every week. Raising or lowering temperature changes randomness, not knowledge. Indexing the manuals in Azure AI Search and grounding each prompt with retrieved passages keeps answers current and citable. When the problem is knowledge freshness, the answer is retrieval, not training.

Skill groups 3

Official skill groups from the Microsoft outline, in outline order.

2.1 Build generative AI solutions with Microsoft FoundryHubs and projects, model deployment, prompt flow, RAG, evaluation, the Foundry SDK and prompt templates.
What it means
Microsoft Foundry is the portal and SDK where you organize work into projects (optionally under a hub that shares connections, storage and security settings), deploy models from the catalog, build prompt flows, add your data for RAG, run evaluations, and connect the result to an application through the Foundry SDK.
What to understand
RAG means retrieving relevant chunks from an index (usually Azure AI Search with vector or hybrid search) and inserting them into the prompt so the model answers from them. Prompt flow chains nodes (LLM, prompt, Python, tools) into standard, chat or evaluation flows that can be deployed as an endpoint. Evaluation uses AI-assisted metrics such as groundedness, relevance, coherence and fluency, plus risk and safety evaluators, and compares runs before release.
How it shows up
Expect a step order for grounding a model in company files, a choice of evaluation metric for a described quality issue, or where to define a connection so several projects can share it.
Common confusion
Groundedness and relevance get swapped. Groundedness asks whether the answer is supported by the retrieved context; relevance asks whether it addresses the user's question.
2.2 Use Azure OpenAI in Foundry Models to generate contentProvision, deploy and call Azure OpenAI models for text, code, images and multimodal input.
What it means
You create an Azure OpenAI resource (or a Foundry resource that includes it), deploy a specific model and version under a deployment name, and call it through the chat completions API with a list of messages. You also generate images with DALL-E and send images to multimodal models such as GPT-4o.
What to understand
Code calls the deployment name, not the base model name. The system message sets behavior and rules, user messages carry the request, and assistant messages hold earlier replies or few-shot examples. DALL-E 3 returns one image per request with set sizes (1024x1024, 1792x1024, 1024x1792), and multimodal input sends an image URL or base64 data inside the user message content array.
How it shows up
A code snippet uses the wrong identifier, omits the system message, or builds the image content part incorrectly, and you complete or fix it.
Common confusion
Passing the model name such as gpt-4o where the API expects the deployment name you chose. They are only the same if you named the deployment that way.
2.3 Optimize and operationalize a generative AI solutionParameters, monitoring, scaling, tracing, reflection, edge containers, orchestration, prompt engineering and fine-tuning.
What it means
After a solution works, you tune sampling parameters, monitor tokens and latency, plan for quota and model version retirement, trace calls to find failures, collect user feedback, add reflection steps, orchestrate several models, improve prompts, and fine-tune a model when prompting is not enough.
What to understand
Temperature (0 to 2) and top_p both control randomness; adjust one, not both. Frequency and presence penalties reduce repetition. Tracing through OpenTelemetry to Application Insights shows each step's inputs, outputs and latency. Model reflection asks a model to critique and revise its own draft before returning it. Fine-tuning uses JSONL training files of example conversations and pays off for consistent tone or format, not for adding fresh facts.
How it shows up
A symptom such as random answers, repeated phrases, rising cost or a slow step in a chain is described, and you pick the parameter, monitoring tool or technique that addresses it.
Common confusion
Fine-tuning to teach the model new facts. Fine-tuned knowledge goes stale and is hard to cite; RAG is the expected answer for factual knowledge.

High-yield concepts

The terms, rules and formulas this domain turns into questions most often.

  • Retrieval augmented generation (RAG)

    RAG retrieves relevant passages from an index at query time and places them in the prompt so the model answers from your data.

    Remember
    The usual pipeline is chunk, embed, index in Azure AI Search, retrieve with hybrid search and semantic ranking, then generate with citations.
    Tested as
    It is the expected answer for private, changing or citable knowledge.
    Trap
    Choosing fine-tuning for knowledge that changes, which needs retraining at every change.
  • Embeddings

    An embedding model converts text into a numeric vector so semantically similar passages land close together.

    Remember
    The same embedding model must be used at index time and query time, and the index field's dimensions must match the model's output.
    Tested as
    Questions about vector search setup and broken retrieval often hinge on mismatched models or dimensions.
    Trap
    Using a chat model deployment to generate embeddings.
  • Hub vs. project

    A hub is a shared container for connections, compute, storage and security settings; projects are workspaces where teams build and deploy.

    Remember
    Put shared connections and network rules on the hub so every project under it inherits them.
    Tested as
    Scenarios with several teams sharing one Azure AI Search connection point to the hub.
    Trap
    Recreating the same connection in every project.
  • Prompt flow

    Prompt flow is a visual and code tool that chains LLM, prompt and Python nodes into an executable flow.

    Remember
    Standard flows process input, chat flows keep chat history, and evaluation flows score another flow's outputs.
    Tested as
    Questions ask which flow type fits a goal or where to add a Python step.
    Trap
    Using a standard flow for a conversational app that needs chat history.
  • AI-assisted evaluation metrics

    Foundry evaluators use a judge model to score answers for groundedness, relevance, coherence and fluency, and include risk and safety evaluators.

    Remember
    Groundedness compares the answer to the context; similarity and F1 score compare it to a ground-truth answer you supply.
    Tested as
    A described quality problem must be matched to the metric that measures it.
    Trap
    Choosing fluency for an answer that is well written but factually unsupported.
  • Message roles

    Chat completions take an ordered list of messages with the roles system, user and assistant (plus tool for tool results).

    Remember
    The system message sets rules and persona; few-shot examples are pairs of user and assistant messages.
    Tested as
    Code completions ask which role carries instructions or examples.
    Trap
    Putting standing instructions in a user message where later turns can override them more easily.
  • Temperature and top_p

    Temperature scales randomness of token selection (0 to 2); top_p limits sampling to the smallest set of tokens whose probability adds up to p.

    Remember
    Lower values give more deterministic output; Microsoft advises changing one or the other, not both.
    Tested as
    Requirements for consistent answers point to a low temperature.
    Trap
    Raising temperature to improve factual accuracy.
  • Frequency and presence penalties

    Both range from -2 to 2. Frequency penalty lowers a token's likelihood in proportion to how often it has appeared; presence penalty lowers it once it has appeared at all.

    Remember
    Frequency penalty reduces repetitive wording; presence penalty pushes the model toward new topics.
    Tested as
    A scenario with repeated phrases points to frequency penalty.
    Trap
    Using max_tokens to fix repetition, which only truncates the answer.
  • Fine-tuning data format

    Chat models are fine-tuned with JSONL files where each line holds a messages array of system, user and assistant turns.

    Remember
    Provide training and optional validation files; a fine-tuned deployment has an hourly hosting charge on top of token costs.
    Tested as
    Questions ask for the file format or the cost consequence of fine-tuning.
    Trap
    Supplying CSV prompt and completion columns, the format of older completion models.
  • DALL-E 3 image generation

    DALL-E 3 creates images from a text prompt with set sizes, a quality of standard or hd, and a style of vivid or natural.

    Remember
    DALL-E 3 returns one image per request (n=1) and may revise your prompt; the response includes the revised prompt.
    Tested as
    Code completions ask for valid size values or how to get several images.
    Trap
    Setting n to 4 with DALL-E 3 instead of sending four requests.
  • Tracing

    Tracing records each call in a chain (prompt, retrieval, tool, model) with inputs, outputs, tokens and timings, using OpenTelemetry and Application Insights.

    Remember
    Use tracing to find which step failed or is slow; use feedback collection to link user ratings to specific traces.
    Tested as
    A multi-step app with an unexplained bad answer points to tracing.
    Trap
    Relying on resource-level metrics, which show totals but not which step went wrong.
  • Model reflection

    Reflection runs a second pass where a model reviews its own draft against criteria and revises it.

    Remember
    It trades extra tokens and latency for higher accuracy on complex tasks.
    Tested as
    Scenarios that need self-checking of plans or code before returning point here.
    Trap
    Expecting reflection to add knowledge the model never had; it improves reasoning, not facts.
  • Model version updates

    Deployments pin a model version and can auto-upgrade to a new default or stay on a version until it retires.

    Remember
    Test the new version with your evaluation set before switching production, because behavior and token use change.
    Tested as
    Operational questions ask how to avoid surprise behavior changes.
    Trap
    Leaving auto-upgrade on for a regulated workload that needs a validated version.

Side by side

Concepts candidates mix up, compared on the point that decides the answer.

Prompt engineering vs. RAG vs. fine-tuning

ConceptMeaningKey differenceCommon trap
Prompt engineering Better instructions, examples and structure in the prompt Cheapest and fastest; limited by context and consistency Skipping it and jumping to fine-tuning
RAG Inject retrieved passages from your data at query time Adds current, citable knowledge without training Expecting it to fix tone or output format
Fine-tuning Train a model on example conversations Changes behavior, style and format; costs training and hosting Using it to teach frequently changing facts

Groundedness vs. relevance vs. coherence vs. fluency

ConceptMeaningKey differenceCommon trap
Groundedness Answer claims are supported by the provided context Measures fabrication against sources Confusing it with relevance
Relevance Answer addresses the user's question Measures fit to the question, not truth Assuming a relevant answer is grounded
Coherence Answer is logically organized and consistent Measures structure of reasoning Mixing it up with fluency
Fluency Answer is grammatical and natural Measures language quality only Using it to judge factual quality

Temperature vs. top_p vs. max_tokens vs. frequency penalty

ConceptMeaningKey differenceCommon trap
Temperature Scales randomness across all tokens Low means repeatable output Treating it as an accuracy setting
top_p Samples from the top probability mass Alternative randomness control Changing it together with temperature
max_tokens Caps response length Controls cost and truncation Using it to stop repetition
Frequency penalty Penalizes tokens by how often they appeared Reduces repeated wording Confusing it with presence penalty

Exam traps

Each trap is an answer that looks right. Learn the clue that should change your mind.

  1. Fine-tune for fresh knowledge

    What candidates pick
    Fine-tune the model on the latest policy documents.
    Why it looks right
    Training sounds like the deepest way to teach a model something.
    Why it's wrong
    Facts learned by fine-tuning go stale and cannot be cited; every policy update would need another training run.

    Clue to watch for Content that changes often, or a requirement to cite sources.

  2. Temperature as a truth dial

    What candidates pick
    Set temperature to 0 to stop the model inventing facts.
    Why it looks right
    Lower temperature does make answers more consistent.
    Why it's wrong
    A deterministic model can still state the same wrong fact every time; fabrication is fixed by grounding and groundedness checks.

    Clue to watch for The problem is described as made-up or unsupported facts rather than inconsistent wording.

  3. Model name in the API call

    What candidates pick
    Pass gpt-4o as the model in the Azure OpenAI client.
    Why it looks right
    Public OpenAI examples use the model name.
    Why it's wrong
    Azure OpenAI routes by deployment name; if the deployment is named support-chat, that is the value the call needs.

    Clue to watch for The scenario states a custom deployment name.

  4. Relevance for hallucination

    What candidates pick
    Evaluate the RAG app with the relevance metric to catch fabricated answers.
    Why it looks right
    A bad answer feels irrelevant.
    Why it's wrong
    An answer can address the question perfectly and still invent facts; groundedness compares claims to the retrieved context.

    Clue to watch for The complaint is that answers contain details not in the documents.

  5. Several DALL-E 3 images in one call

    What candidates pick
    Set n=4 to get four logo concepts from DALL-E 3.
    Why it looks right
    The parameter exists in the API.
    Why it's wrong
    DALL-E 3 supports one image per request; you need four requests or a model that supports multiple outputs.

    Clue to watch for The scenario names DALL-E 3 and asks for several images.

  6. Standard flow for a chatbot

    What candidates pick
    Build the assistant as a standard prompt flow.
    Why it looks right
    Standard flow is the default template.
    Why it's wrong
    A conversational app needs chat history passed between turns, which the chat flow type provides.

    Clue to watch for Follow-up questions that refer to earlier turns.

Answer framework

Use this sequence when a generative AI scenario asks how to build or improve a solution.

  1. State the symptom precisely: missing knowledge, wrong format, inconsistent wording, unsafe output, high cost or slow response.
  2. Try the lightest fix first: a clearer system message, few-shot examples and explicit output format instructions, before paying for any training.
  3. Add RAG when answers need private, current or citable data, and confirm the embedding model and index fields match.
  4. Reserve fine-tuning for stable style or format requirements that prompting cannot hold, and budget for the hourly hosting of the tuned deployment.
  5. Prove the change with evaluation runs on groundedness, relevance and safety, then trace production calls and collect feedback to catch regressions.

Practice question

A legal team's assistant must answer from internal contracts that are amended every week, and each answer must cite the clause it used. Responses currently mention clauses that no longer exist. Which approach should you implement?

Choose one answer

Want more like this? The AI-102 practice test has questions for every domain.

Checklist

0 of 13

Tick each one you can do without notes. Your ticks stay in this browser.

Study strategy

Begin with the chat completions API, because every other topic sits on it. Deploy one model, call it from code by deployment name, and experiment with the system message, few-shot examples, temperature and max_tokens until you can predict what each change does.

Then build one RAG solution end to end in Foundry: upload a few documents, let Foundry create the Azure AI Search index with embeddings, and query it from code. Break it on purpose by asking about content that is not indexed, and watch the groundedness score drop when you run an evaluation. This single exercise covers the highest-priority concepts: retrieval, embeddings, evaluation metrics and the RAG versus fine-tuning decision.

Commonly underestimated areas are the operational topics: tracing, model version upgrades, deployment quotas, and the exact fine-tuning file format. Read the fine-tuning guidance once and write a three-line JSONL file by hand. Also try DALL-E 3 and a multimodal image prompt so the request shapes are familiar.

Afterwards, move to Domain 3, which reuses these models and tools inside agents, and practice symptom-to-technique questions until you can name the fix from the first sentence of a scenario.

FAQ

How much of AI-102 covers generative AI?

Implement generative AI solutions is weighted at 15-20% in the final AI-102 study guide. Agents (5-10%) and parts of planning and responsible AI build on the same models, so generative AI knowledge supports more than this one area.

When should I choose RAG over fine-tuning?

Choose RAG when the model needs private, frequently changing or citable information. Choose fine-tuning when you need a consistent style, format or specialized behavior that prompts cannot hold, and the underlying knowledge is stable.

Do I need to write prompt flow code for the exam?

You should know the flow types, the node types (LLM, prompt, Python, tools), how connections supply credentials, and that a flow can be deployed as an endpoint. Short code or YAML reading is possible, but the focus is on choosing and configuring.

What is the difference between groundedness and relevance?

Groundedness checks whether the answer's claims are supported by the retrieved context. Relevance checks whether the answer addresses the question. An answer can be relevant and still ungrounded.

Which parameters should I memorize?

Temperature and top_p for randomness, max_tokens for length and cost, stop sequences for where output ends, and frequency and presence penalties for repetition. Know what symptom each one fixes.

Is this domain hard for developers who already use OpenAI APIs?

The API is familiar, but Azure-specific details catch people: deployment names instead of model names, Foundry hubs and projects, content filters per deployment, and Azure AI Search as the retrieval layer.

How does this connect to knowledge mining in Domain 6?

Azure AI Search is the retrieval layer for most RAG solutions, so vector fields, hybrid search and semantic ranking from Domain 6 directly decide how well a grounded answer performs here.

Other Artificial Intelligence & Machine Learning certifications

Where the same subject shows up in other exams. Cards marked "Same subject" open the matching domain.

Test your Domain 2 knowledge

You have just compared prompt engineering, RAG and fine-tuning, matched evaluation metrics to quality problems, and reviewed the parameters that control generation. Practice questions test whether you can spot the deciding symptom in a scenario.

Keep going