Q1.Note: This section contains one or more sets of questions that address the same scenario and problem.
Each question presents a unique solution to that problem.
Determine whether the presented solution achieves the stated goal.
Within a set, more than one solution may be valid, or none of the solutions may meet the goal.
After you answer a question in this section, you cannot return to the previous question.
As a result, these questions do not appear on the review screen.
A company operates a multimodal generative AI model that accepts image uploads and generates responses based on text read from the images.
It has been discovered that users can send dangerous images or embed hidden instructions inside images to manipulate the model.
You need to introduce a control to mitigate this risk.
Solution: You configure protected material detection.
Does this solution meet the goal?
Show answer
Protected material detection is a feature that determines whether the generated output matches known copyrighted content such as text, song lyrics, articles, recipes, or code.
It is not a countermeasure against unsafe images or hidden instructions embedded within images.
For dangerous images themselves, you use image analysis in Azure AI Content Safety, and for indirect prompt injection such as malicious instructions extracted from an image, you use document attack detection with Prompt Shields.
Therefore, this solution alone does not meet the goal.
Note that Azure AI Content Safety is now also available through Microsoft Foundry, but the service name itself is unchanged.
Prompt Shields
What is Azure AI Content Safety?
Q2.A help desk department operates a customer support agent using Microsoft Foundry Agent Service.
Customers sometimes return to a session to resume the same inquiry case a few days later.
At that time, the agent must resume the conversation with the full history of past interactions carried over.
The agent is required to provide the following capabilities.
Continuity across multiple turns within a session
Continuity across sessions for the same case
Access to the complete conversation history, including user messages, agent messages, tool calls, and tool outputs
Furthermore, the agent must automatically reload the complete history at the start of each new turn.
Which approach should you adopt?
Show answer
The conversation object in Microsoft Foundry Agent Service is a persistent unit that retains messages and tool execution results across multiple turns.
If you save the conversation ID in association with the case and specify the same ID in subsequent requests, you can reuse the conversation history that remains on the service side as-is.
Storing only the final response loses the user messages, tool calls, and tool outputs.
Also, summary memory compresses information, so it is not suitable for the requirement of retaining the complete history.
Therefore, the approach of continuing to use the same conversation ID for the same case is correct.
Older documentation sometimes uses the term “thread,” but the newer service mainly uses the components “conversation” and “response.”
Build using agents, conversations, and responses
Quickstart: Get started with the Microsoft Foundry SDK
Q3.You operate a Microsoft Foundry project that handles a large volume of chat requests.
The majority of incoming requests are simple FAQs, but some require advanced reasoning.
You need to reduce the cost and latency of general inquiries without lowering the answer quality for complex questions.
Which approach is appropriate?
Show answer
A model cascade sends simple FAQs to a small, fast, low-cost model and routes only complex questions to a high-performing reasoning model.
This reduces overall cost and latency while maintaining quality for difficult questions.
Increasing max_tokens typically increases the number of output tokens and the processing time instead.
Sending everything to a small model lowers the quality of complex questions, while sending everything to a high-performing model incurs wasted cost on simple FAQs.
In current Microsoft Foundry, this mechanism is mainly called the “model router,” which automatically selects the optimal model for each prompt by considering quality, cost, and latency.
Model router in Microsoft Foundry
Use a model router in Microsoft Foundry
Q4.You operate a Microsoft Foundry project that includes an agent.
This agent uses tools to retrieve internal content and call external APIs.
The agent is configured so that the model itself can decide when to call a tool.
You need to publish this agent for compliance-related workflows.
The solution must meet the following requirements.
Each workflow execution must always run the retrieval step before generating a response.
Tool calls must authenticate using the published agent’s own identity.
Access to tools must use an identity that is isolated from other project resources.
Access to tools must support traces that can be used for auditing.
Select the appropriate options in the answer area.
Show answer
Setting tool_choice to required forces the model to call at least one tool when generating a response, making the retrieval step mandatory.
With auto, a tool may not be called, and with none, tool calls themselves are prohibited.
Before publishing, the agent shares an identity within the project, but after publishing, each agent is assigned a unique agent ID.
Using a separate agent ID lets you isolate access rights from other project resources and perform authentication, permission management, and auditing on a per-agent basis.
Storing an API key in the prompt is not secure, and a shared project ID cannot achieve the required isolation.
Note that in Microsoft Foundry, Application Insights and OpenTelemetry let you record execution traces that include retrieval processing and tool calls.
Agent identity concepts in Microsoft Foundry
Set up authentication for Model Context Protocol (MCP) tools
Q5.You have been asked to propose a plan to build a customer support agent using Microsoft Foundry Agent Service.
This agent must meet the following requirements.
Retain user preferences across multiple conversations.
Allow users to upload documents directly during a chat and perform grounding based on their content.
Which Foundry feature should you recommend for each requirement?
Select the appropriate options in the answer area.
Show answer
Agent memory is a long-term memory feature that retains user preferences and information extracted from past interactions in a persistent memory store, allowing reuse across different sessions and conversations.
Conversation history and session context are mainly used to continue the same conversation or a temporary execution state.
The file search tool registers documents uploaded during a chat into a vector store and searches their content to use as grounding for answers.
Azure AI Search is suited for integration with a prebuilt enterprise search foundation, and the code interpreter is intended for file computation and data analysis.
Note that the former name Azure AI Foundry is now presented under the name Microsoft Foundry.
Memory in Microsoft Foundry Agent Service (preview)
Create and use memory in Foundry Agent Service (preview)
Q6.Within a Microsoft Foundry project, you have a chat app and a vectorized index in Azure AI Search.
You need to connect the chat app to this index so that it meets the following requirements.
Complex questions require gathering information from multiple chunks.
The retrieval plan must reflect the content of multi-turn conversations.
To reduce latency, retrieval processing must run in parallel.
Which retrieval approach should you adopt?
Show answer
Agentic retrieval is a multi-query RAG pipeline that uses an LLM to break a complex question into multiple focused subqueries and gathers relevant information from multiple chunks.
Because conversation history can be included in generating the subqueries, it can realize a retrieval plan that takes past turns into account.
Furthermore, it runs the generated subqueries in parallel and merges and re-ranks the retrieval results, so it can reduce latency while maintaining accuracy.
Traditional RAG typically uses a single search query and therefore cannot meet the requirements, and Chain-of-Thought is a reasoning technique, not a retrieval method in Azure AI Search.
Agentic RAG, which satisfies all three requirements—multiple chunks, a plan that considers conversation history, and parallel retrieval—is correct.
In current official documentation, this feature is described as “agentic search” or “agentic retrieval.”
Agentic retrieval in Azure AI Search
Retrieval-augmented generation (RAG) in Azure AI Search
Q7.You have an app named App1 that uses a deployment of a multimodal model in Microsoft Foundry.
App1 performs optical character recognition (OCR) on uploaded images and appends its output to the prompt as additional context.
Some of the uploaded images contain embedded text.
You need to prevent potentially malicious instructions from being processed by the model.
What should you use?
Show answer
Text extracted from an image via OCR is added to the prompt as external content rather than as a prompt entered directly by the user, so it is treated as indirect prompt injection.
Prompt Shields for documents detects malicious instructions embedded in text extracted from documents, email, web pages, images, and the like.
Prompt Shields for user prompts is used to detect attacks entered directly by users.
Image moderation is a feature that detects harmful visual content such as violence or sexual expression, and is not a countermeasure against instructions within OCR text.
Therefore, inspecting the OCR output with Prompt Shields for documents before passing it to the model is appropriate.
Protected material detection is a feature that detects matches with copyrighted material and does not apply to this requirement.
Prompt Shields
Prompt Shields in Microsoft Foundry
Q8.Note: This section contains one or more sets of questions that address the same scenario and problem.
Each question presents a unique solution to that problem.
Determine whether the presented solution achieves the stated goal.
Within a set, more than one solution may be valid, or none of the solutions may meet the goal.
After you answer a question in this section, you cannot return to the previous question.
As a result, these questions do not appear on the review screen.
You have a Microsoft Foundry project that includes an agent, and this agent generates summaries from retrieved policy documents.
Users report that even when the required regulatory clause exists within the retrieved content, that clause is missing from some responses.
You need to improve the completeness of the responses.
Solution: You run an evaluation flow that scores response completeness and blocks responses that fall below a defined threshold.
Does this solution meet the goal?
Show answer
Response completeness evaluation is a feature that measures how well the generated answer covers the important information contained in the ground truth or expected answer.
It can detect and block answers below the threshold, but it does not add the missing regulatory clause to the answer or improve the generation process itself.
To improve completeness, you need to add a validation process that compares the retrieved content with the generated result and, if something is missing, prompts regeneration or correction.
An evaluation flow is merely a mechanism for measuring quality; by itself it is not a control that improves answer quality, so this solution does not meet the goal.
Retrieval-augmented generation (RAG) evaluators
ResponseCompletenessEvaluator class
Q9.You have a Python application named App1 that integrates with a Microsoft Foundry project named Project1.
You need to ensure App1 meets the following requirements.
Authenticate using a Microsoft Entra managed identity.
Use the Azure OpenAI Responses API to send prompts to a deployed model.
How should you complete the Python code?
Select the appropriate options in the answer area.
Show answer
DefaultAzureCredential automatically detects the managed identity assigned to an application running on Azure and can use it as Microsoft Entra ID credentials.
AzureKeyCredential is authentication by API key, and ClientSecretCredential is service principal authentication using a tenant ID, client ID, and client secret, neither of which fits the managed identity requirement.
You obtain an authenticated OpenAI client via the get_openai_client method of AIProjectClient, and using the responses.create method lets you send the input prompt to the deployed model and generate a new response.
responses.retrieve is a process that retrieves an existing response and is not used to send a new inference request.
compact is also not a method for generating a new response.
Azure AI Foundry has now been renamed Microsoft Foundry, but the basic configuration of combining AIProjectClient with the Responses API is the same.
Microsoft Foundry SDK and endpoints
Use the Azure OpenAI Responses API
Q10.You have a Microsoft Foundry project that ingests scanned PDF invoices stored in Azure Blob Storage.
Each invoice has printed line items arranged in a tabular layout.
The extraction results are stored as structured JSON and used as grounding data for an agent within a retrieval-augmented generation (RAG) solution.
You need to create a single analyzer that meets the following requirements.
Extract the invoice number, invoice date, vendor name, and total amount from invoices of various templates.
Return a confidence score so that results with a confidence below 0.80 can be routed to supervisor review.
What should you use?
Show answer
A custom analyzer in Azure Content Understanding lets you define business fields such as invoice number, invoice date, vendor name, and total amount as a schema and extract them as structured JSON from forms with different layouts.
Because each extraction result can be given a confidence score from 0 to 1, you can implement processing that routes results below 0.80 to human review.
The layout analyzer focuses on extracting characters, tables, and placement, and does not define invoice-specific business items.
Groundedness evaluation measures the groundedness of a generated answer and cannot be used for form field extraction.
search.score is also the relevance of search results, not the confidence of an extracted value.
A custom analyzer, which can achieve field extraction and confidence-based routing in a single configuration, is appropriate.
Azure Content Understanding in document solutions within Foundry Tools
What is a Content Understanding analyzer?
