Skip to content

AI-103 · Domain 2: Implement generative AI and agentic solutions · 33% of the exam

Task 2.1: Build generative applications by using Foundry

Deploying and calling models, retrieval-augmented generation, tool-augmented and multistep flows, evaluating quality, groundedness and safety, and connecting an application to a Foundry project with the SDKs.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.

Question 1 · choose 1

A Python service must create and run Foundry agents, read evaluation results and call models, all in one Foundry project. The team wants one endpoint to configure and no API keys. How should the service connect?

  1. APoint the OpenAI SDK at the resource's /openai/v1 route with an API key
  2. BCall the Azure Resource Manager endpoint of the Foundry resource with a token
  3. CCreate an AIProjectClient on the project endpoint with DefaultAzureCredential
  4. DUse the Foundry Tools SDK for each service, each with its own service endpoint
Show the answer and why
  • APoint the OpenAI SDK at the resource's /openai/v1 route with an API key

    Incorrect

    The API key breaks the no-keys rule, and that route isn't the project endpoint that the agent and evaluation APIs live on.

  • BCall the Azure Resource Manager endpoint of the Foundry resource with a token

    Incorrect

    Resource Manager creates and configures resources; it doesn't run agents or return evaluation results.

  • CCreate an AIProjectClient on the project endpoint with DefaultAzureCredential

    Correct

    The Foundry SDK exposes every project API, including agents and evaluations, through the single project endpoint and works with Entra ID credentials.

  • DUse the Foundry Tools SDK for each service, each with its own service endpoint

    Incorrect

    Foundry Tools SDKs target prebuilt services such as Speech or Vision, each on its own endpoint, not the project's agents.

For agents, evaluations and other project features, use the Foundry SDK with the project endpoint, https://<resource-name>.services.ai.azure.com/api/projects/<project-name>, and a token credential.

Question 2 · choose 1

An app uses the Responses API on the /openai/v1 route. After the team adds a deployment of another model from the catalog, calls to it return 400 with "Model not supported", while the other deployments work. What should the app do for this deployment?

  1. AChange the content filtering configuration of the deployment
  2. BCall it through the Chat Completions API instead
  3. CSwitch the app from API key to Microsoft Entra ID authentication
  4. DRaise the rate limit configured on that model deployment
Show the answer and why
  • AChange the content filtering configuration of the deployment

    Incorrect

    Filtering settings don't change which APIs the deployed model supports.

  • BCall it through the Chat Completions API instead

    Correct

    Not every Foundry model supports the Responses API. The docs say to use Chat Completions when a deployment returns this error.

  • CSwitch the app from API key to Microsoft Entra ID authentication

    Incorrect

    The authentication method doesn't add Responses API support to a model that lacks it.

  • DRaise the rate limit configured on that model deployment

    Incorrect

    Rate limits govern request volume, not which APIs a model supports.

The Responses API works with Azure OpenAI models and with the Foundry models that support it. When a deployment answers 400 "Model not supported", send its requests through Chat Completions.

Question 3 · choose 1

A RAG app retrieves relevant passages from Azure AI Search and adds them to the prompt. Reviewers find that answers are mostly right but sometimes add details that appear in none of the passages. Retrieval quality has already been checked. What should you change first?

  1. ASwitch the index from hybrid queries to keyword-only queries for precision
  2. BInstruct it to answer only from the passages, with citations, or say it can't
  3. CIncrease the passages added to each prompt from 5 to 50 so more facts are present
  4. DFine-tune the model on the passages so that it learns the facts in them
Show the answer and why
  • ASwitch the index from hybrid queries to keyword-only queries for precision

    Incorrect

    Retrieval isn't the issue here; changing the query type doesn't stop the model from adding details.

  • BInstruct it to answer only from the passages, with citations, or say it can't

    Correct

    The RAG guidance for hallucination despite grounding is to enable citations and use clear instructions to stay with retrieved content.

  • CIncrease the passages added to each prompt from 5 to 50 so more facts are present

    Incorrect

    Retrieval is already good; adding passages doesn't stop the model from going beyond them.

  • DFine-tune the model on the passages so that it learns the facts in them

    Incorrect

    Training on the passages won't keep each answer inside the text retrieved for it, and it gives no citations.

When retrieval works but answers still drift, tighten the generation step: tell the model to use only the supplied passages, cite them and admit when the answer isn't there. Measure the result with a groundedness check.

Question 4 · choose 2

You are evaluating a RAG app before release. The test set has each query, the retrieved context and the app's response, but no reference answers. You must detect answers that invent content not in the context and answers that don't address the question. Which two evaluators should you use? (Choose TWO.)

  1. ACoherence
  2. BSimilarity
  3. CGroundedness
  4. DRelevance
  5. EFluency
Show the answer and why
  • ACoherence

    Incorrect

    Coherence rates logical flow; a coherent answer can still invent content or miss the question.

  • BSimilarity

    Incorrect

    Similarity compares the response with a reference answer, which this test set doesn't have.

  • CGroundedness

    Correct

    Groundedness checks whether the response stays within the given context without fabricating content, and needs no ground truth.

  • DRelevance

    Correct

    Relevance judges how well the response addresses the query, using only the query and response.

  • EFluency

    Incorrect

    Fluency rates readability, not whether content is supported or on topic.

Pick evaluators by the data you have and the failure you're hunting. Without reference answers, Groundedness (precision against the context) and Relevance (does it answer the query) cover fabrication and off-topic replies.

Question 5 · choose 1

In a two-step pipeline, a model extracts order details and code in the second step reads fixed fields such as order_id and items. JSON mode is on, yet some responses are valid JSON with renamed or missing fields, which break the second step. What should you use?

  1. AStructured Outputs with a JSON schema for the order details
  2. BA higher temperature so the model explores more field names
  3. CA larger maximum output token setting
  4. DFew-shot examples alone, with JSON mode left on
Show the answer and why
  • AStructured Outputs with a JSON schema for the order details

    Correct

    Structured Outputs constrain the model to the JSON schema you supply, which JSON mode doesn't guarantee.

  • BA higher temperature so the model explores more field names

    Incorrect

    More randomness makes field names less predictable, not more.

  • CA larger maximum output token setting

    Incorrect

    Output length isn't the problem; complete JSON with the wrong fields is.

  • DFew-shot examples alone, with JSON mode left on

    Incorrect

    Examples help, but JSON mode only guarantees valid JSON, not a schema, so drift can still happen.

JSON mode promises parseable JSON. Structured Outputs go further and make the response follow a JSON Schema, which is what a downstream step that reads named fields needs.

Question 6 · choose 1

A research feature sends a hard question to a reasoning model through the Responses API. Some requests run for many minutes, and the client's HTTP connection times out before the answer arrives. The team wants to start the request, return to the user, and fetch the result later. What should they use?

  1. ALower the reasoning effort to its minimum value for every request
  2. BSet store to false so that the service doesn't keep the response
  3. CRaise max_output_tokens so that the answer finishes sooner
  4. DBackground mode, then poll the response by ID until it completes
Show the answer and why
  • ALower the reasoning effort to its minimum value for every request

    Incorrect

    Less reasoning shortens requests but weakens answers to hard questions, and nothing guarantees it beats the timeout.

  • BSet store to false so that the service doesn't keep the response

    Incorrect

    Background mode requires store=true; stateless requests aren't supported for it.

  • CRaise max_output_tokens so that the answer finishes sooner

    Incorrect

    A higher cap allows more output; it doesn't shorten processing or keep a connection open.

  • DBackground mode, then poll the response by ID until it completes

    Correct

    Background tasks run asynchronously; you poll for completion or cancel them, so no connection has to stay open.

For long reasoning tasks, start a background response and poll it by ID. Background mode needs stored responses, so keep store set to true.

Question 7 · choose 1

A RAG app built with the Foundry SDK queries an Azure AI Search index. The search endpoint and key are copied into the app's settings in every environment, and the platform team wants one governed place to manage that link per project. What should the team use?

  1. AEnvironment variables loaded from one shared configuration file in the repo
  2. BA project connection to the search service, read via the project client
  3. CA vector store created by the agent's file search tool for the index
  4. DA separate Foundry resource for each environment and its search index
Show the answer and why
  • AEnvironment variables loaded from one shared configuration file in the repo

    Incorrect

    A shared file is still a copy of the endpoint and key in each deployment, outside the project's governance.

  • BA project connection to the search service, read via the project client

    Correct

    Connections link a project to services such as Azure AI Search, so apps get the target from the project instead of local copies.

  • CA vector store created by the agent's file search tool for the index

    Incorrect

    A vector store doesn't connect the app to its existing Azure AI Search index.

  • DA separate Foundry resource for each environment and its search index

    Incorrect

    More resources multiply the configuration; they don't give one place to manage the link.

Project connections are the Foundry way to wire a project to external resources such as Azure AI Search, with credentials kept by the platform (optionally in your Key Vault). Apps resolve them through the project.

Question 8 · choose 1

A localization team has 2,000 sentences with approved human translations and wants a cheap, repeatable score of how close a model's translations are to them, without using an LLM as the judge. Which evaluator type fits?

  1. AIntent Resolution, rating whether the user's goal was met
  2. BFluency alone, rating how natural each translation sounds
  3. CGroundedness, comparing each translation with retrieved context
  4. DA textual similarity evaluator such as BLEU
Show the answer and why
  • AIntent Resolution, rating whether the user's goal was met

    Incorrect

    That is an agent evaluator for conversations.

  • BFluency alone, rating how natural each translation sounds

    Incorrect

    Fluency uses an LLM judge and ignores the reference translation.

  • CGroundedness, comparing each translation with retrieved context

    Incorrect

    Groundedness checks answers against retrieved context, not against a reference translation.

  • DA textual similarity evaluator such as BLEU

    Correct

    BLEU measures n-gram overlap between the response and ground truth and is a classic translation quality measure.

Textual similarity evaluators (F1, BLEU, GLEU, ROUGE, METEOR) compare output with ground truth algorithmically; pick them when references exist and a deterministic score is wanted.

Question 9 · choose 1

A routing model must output exactly one of the strings BILLING, TECH or SALES, and the test set has the expected label for each message. The team wants a deterministic pass or fail for every row. Which evaluator fits?

  1. AThe Groundedness evaluator against retrieved context
  2. BThe string check grader, comparing outputs with labels
  3. CThe Relevance evaluator run on each routed message
  4. DThe Coherence evaluator with an LLM judge model
Show the answer and why
  • AThe Groundedness evaluator against retrieved context

    Incorrect

    There's no retrieved context here; the check is an exact label.

  • BThe string check grader, comparing outputs with labels

    Correct

    string_check performs deterministic comparisons for exact match validation against a reference.

  • CThe Relevance evaluator run on each routed message

    Incorrect

    Relevance is an LLM-judged quality score.

  • DThe Coherence evaluator with an LLM judge model

    Incorrect

    Coherence judges logical flow, not exact label matches.

Azure OpenAI graders include deterministic graders (string check, text similarity) and model-based ones (labeler, scorer). Use deterministic checks when the right answer is a fixed string.

Question 10 · choose 1

A desktop app sends screenshots stored only on the user's machine to a vision-capable model through the Responses API. The images have no public URL. How can the app include them in the request?

  1. AEncode each image as base64 and send it as input
  2. BDescribe the screenshot in text and send the description
  3. CUpload each image to a vector store for the file search tool
  4. DSend only the file path of each image on the user's disk
Show the answer and why
  • AEncode each image as base64 and send it as input

    Correct

    Image input accepts a base64-encoded image as well as image URLs and file IDs.

  • BDescribe the screenshot in text and send the description

    Incorrect

    A description loses the visual details the model should see.

  • CUpload each image to a vector store for the file search tool

    Incorrect

    Vector stores index documents for retrieval, not image input.

  • DSend only the file path of each image on the user's disk

    Incorrect

    The service can't read a local path on the user's machine.

Multimodal requests can carry images by URL, base64 data or an uploaded file ID; pick the one that fits where the image lives.

Question 11 · choose 1

A developer copies Python samples that pin azure-ai-projects 1.0.0, but the team's agents live in Foundry projects in the new Foundry portal. Which package version line should the app use?

  1. Aazure-ai-projects 2.x, the stable line for Foundry (new)
  2. BThe azure-ai-inference package instead of azure-ai-projects
  3. CAny version, since every release supports both portals
  4. Dazure-ai-projects 1.0.0, as pinned in the sample
Show the answer and why
  • Aazure-ai-projects 2.x, the stable line for Foundry (new)

    Correct

    The 2.x SDK targets Foundry (new); 1.x is the stable line for Foundry (classic).

  • BThe azure-ai-inference package instead of azure-ai-projects

    Incorrect

    azure-ai-inference retired on August 26, 2026.

  • CAny version, since every release supports both portals

    Incorrect

    The docs map SDK versions to portal versions.

  • Dazure-ai-projects 1.0.0, as pinned in the sample

    Incorrect

    1.0.0 targets Foundry (classic) projects.

Match the SDK to the platform: azure-ai-projects 2.x for Foundry projects in the new portal, 1.x for classic.

Question 12 · choose 1

An app uses stored Responses API calls. A user asks that the conversation be removed now rather than waiting for default retention to expire. What should the app do?

  1. ATurn off tracing so that the response is no longer kept
  2. BDelete each stored response by ID through the API
  3. CRedeploy the model so that its stored data resets now
  4. DWait 30 days for the data to expire on its own
Show the answer and why
  • ATurn off tracing so that the response is no longer kept

    Incorrect

    Tracing is separate telemetry; it doesn't delete stored responses.

  • BDelete each stored response by ID through the API

    Correct

    Response data is retained for 30 days by default, and a stored response can be deleted by ID.

  • CRedeploy the model so that its stored data resets now

    Incorrect

    Deployments don't hold stored responses.

  • DWait 30 days for the data to expire on its own

    Incorrect

    That ignores the user's request to remove it now.

Stored responses can be retrieved, listed and deleted by ID. Plan data removal requests alongside your own telemetry and storage.

Practise domain 2 →Practise all domains →