Microsoft certification · Exam AI-200

AI-200 Mock Exam Page 3

Developing AI Cloud Solutions on Azure

Free AI-200 mock exam questions 21–30, each with the answer and an explanation.

20 questions · 40 minutes · free, no sign-up

Free AI-200 questions

21–30 of 42 free
Question 21 Choose 2
You are designing an Azure Function app that processes large image uploads submitted by users through an HTTP endpoint.
The solution must:

• Prevent client timeouts by decoupling image processing from the initial upload request.
• Support automatic retry behavior for failed processing attempts.
• Scale the background processing independently of the rate of incoming HTTP uploads.

You need to design a scalable and reliable asynchronous processing solution.
Which two actions should you implement? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, B Implement a queue-triggered function for image processing. Configure retry policies on a storage queue.

Explanation

Explanation

A. Implement a queue-triggered function for image processing: This decouples the processing from the initial upload, preventing client timeouts. It also allows the background processing (the queue-triggered function) to scale independently based on the number of messages in the queue, rather than the rate of incoming HTTP requests.

B. Configure retry policies on a storage queue: To support automatic retry behavior for failed processing attempts, you configure retry policies either on the function's trigger (built-in retries for Event Grid/Queue) or specifically by using the maxDequeueCount property for Azure Storage Queues. When a queue-triggered function fails, the message is returned to the queue and retried.

Why the Other Options Are Incorrect

C. Process the image inside the HTTP-triggered function: This is a synchronous pattern. It would keep the HTTP request open during the entire image processing duration, which risks client timeouts and does not scale the processing independently.

D. Persist upload metadata to Azure Storage: While storing metadata is good practice for auditing, it does not solve the core requirements of decoupling processing, enabling automatic retries, or scaling independently.

References

Microsoft Learn: Asynchronous processing with Azure Functions and Queues
Question 22
You are developing an application that uses a Python API to perform similarity queries against Azure Database for PostgreSQL. The application creates a new database connection for every request.
During peak traffic, the application intermittently fails to open new database sessions, logs indicate that the maximum number of connections have been reached.
You need to configure the connection pooling strategy to reduce connection setup overhead and maximize reuse for the high-concurrency workload.
What should you configure? To answer. select the appropriate options in the answer area NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

PgBouncer: The application is creating a new connection for every request, leading to connection exhaustion during peak traffic. PgBouncer is a lightweight, highly efficient connection pooler for PostgreSQL. It maintains a pool of active database connections and shares them among many clients, drastically reducing the overhead of connection setup and teardown. (Note: Azure Database for PostgreSQL Flexible Server offers PgBouncer as a built-in feature).

Transaction pooling mode: To maximize reuse for high-concurrency workloads, Transaction pooling mode is the most efficient. In this mode, a server connection is assigned to a client only for the duration of a single transaction. Once the transaction is complete, the connection is immediately returned to the pool for another client to use. This allows a very small number of actual database connections to serve a massive number of concurrent application requests.

Why the Other Options Are Incorrect

Compute tier scaling / Connection timeout extension: These are infrastructure or configuration tweaks that do not solve the fundamental issue of connection churn (opening and closing connections for every request).

Automatic vacuum: This is a database maintenance process for reclaiming storage, not a connection pooling technology.

Session pooling mode: In session mode, a server connection is assigned to a client for the entire duration of their session. While better than no pooling, it still holds connections open longer than necessary, limiting the maximum number of concurrent clients compared to transaction mode.

Statement pooling mode: This mode returns connections to the pool after every statement. It is rarely used because it breaks multi-statement transactions (unless auto-commit is used).

References

Microsoft Learn: Connection pooling in Azure Database for PostgreSQL - Flexible Server (Covers PgBouncer and pooling modes).
Question 23
You are developing an AI application that retrieves database credentials from Key Vault by using the Azure SDK for Python.
The application must use managed identity for authentication.


For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

Statement 1 (Yes): Look at line 10 of the code: secret = client.get_secret("dbPassword", version="123"). The version="123" parameter explicitly tells the SDK to retrieve that exact version of the secret, rather than the latest one.

Statement 2 (Yes): Line 04 uses DefaultAzureCredential(). When an application is deployed to an Azure environment with a managed identity enabled (like Azure App Service, Azure Functions, or Azure Container Apps), DefaultAzureCredential automatically detects the managed identity and uses it to authenticate. This eliminates the need to store client secrets, passwords, or certificates in the code.

Statement 3 (No): Because line 10 explicitly pins the retrieval to version="123", the code will always retrieve version 123. If the secret is rotated and a new version (e.g., version "124") is created, this specific code will still return the older version "123" until the code is updated to request the new version or no version at all.

References

Microsoft Learn: DefaultAzureCredential overview
Question 24
You deploy an API to Azure Container Apps.
The solution must provide the following functionality:

• Support the concurrent activation of multiple application versions.
• Allocate a specific percentage of incoming requests to a secondary version
You need to configure revision behavior.

Which configurations should you use? To answer, move the appropriate configurations to the correct requirements. You may use each configuration once, more than once, or not at all. You may need to move the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

Multiple revision mode: By default, Azure Container Apps uses "Single revision mode," which automatically routes 100% of traffic to the latest deployed revision and deactivates older ones. To support concurrent activation of multiple application versions (allowing you to test a new revision while production traffic continues to flow to the stable version), you must enable Multiple revision mode.

Traffic splitting: Once multiple revisions are active, you can use traffic splitting to divide incoming requests between them. By assigning weights (e.g., 80% to the stable production revision and 20% to the new test revision), you can safely route a specific percentage of traffic to the new version for canary testing or A/B testing.

Why the Other Options Are Incorrect

Single revision mode: This mode forces all traffic to the newest revision, which would immediately affect production traffic and prevent testing a new revision in isolation.

Traffic isolation: This is not a standard Azure Container Apps configuration feature for version routing (though you can achieve isolation using dedicated environments or internal ingress). It does not handle percentage-based traffic allocation.

References

Microsoft Learn: Revisions in Azure Container Apps (Explains Single vs. Multiple revision modes).

Microsoft Learn: Traffic splitting in Azure Container Apps (Explains how to route percentages to different revisions).
Question 25
You have a newly provisioned Azure subscription. You are designing a custom Event Grid workflow for AI inference events.
You need to implement the Event Grid components to support routing of high-confidence events to a downstream processor.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Show answerHide answer

Explanation



Explanation

1. Register the provider: In a newly provisioned Azure subscription, the Azure Event Grid resource provider (Microsoft.EventGrid) must be registered before you can create or use Event Grid resources. This step makes the service available to your subscription.

2. Create a custom topic: To design a custom workflow for specific events (like AI inference events), you must create a custom topic. This defines the endpoint to which your application will publish events.

3. Create an event subscription: Finally, once the custom topic exists, you create an event subscription on that topic. This subscription defines the endpoint (the downstream processor) where the events will be delivered and can include filters (such as routing only high-confidence events).

Why the Other Options Are Incorrect

Create a partner topic: Partner topics are used for receiving events from third-party SaaS providers (like Auth0 or Datadog), not for custom application workflows.

Create a domain: Event domains are used to manage a large number of topics for multi-tenant applications (e.g., managing events for thousands of different customers). They are not necessary for a simple custom workflow.

References

Microsoft Learn: Azure Event Grid concepts (Explains custom topics and subscriptions).
Question 26 Choose 1
You process Azure Service Bus messages that require a dependent external API call. If the API is temporarily unavailable, you must delay processing of the message without incrementing the delivery count. You need to find a way to process the message when the API is available while keeping the message accessible. Which message action should you perform?
Show answerHide answer

Correct answer: A Defer

Explanation

Explanation

The requirement is to delay processing the message without incrementing the delivery count, while keeping the message accessible. The Defer action is the only one that satisfies these conditions.

When you defer a message, Service Bus sets its state to deferred. The message remains in the queue (it is not removed, abandoned, or dead-lettered), but it becomes hidden from normal receive operations. Crucially, deferring a message does not increment its DeliveryCount. To process the message later, the application must remember the message's SequenceNumber and explicitly retrieve the deferred message using ReceiveDeferredMessageAsync once the external API is available.

Why the Other Options Are Incorrect

B. Complete: This permanently removes the message from the queue. It is used when processing is successful and would result in losing the message.

C. Dead-letter: This moves the message to the Dead-Letter Queue (DLQ) for messages that cannot be processed (e.g., malformed or expired). It does not keep the message accessible for normal, delayed processing and increments the delivery count.

D. Abandon: This releases the message lock and makes it immediately available for other receivers. Crucially, abandoning a message increments the DeliveryCount, which violates the stated requirement.

References

Microsoft Learn: Deferral of Service Bus messages
Question 27 Choose 1
You are designing an Azure Function app that exposes a public API.
The solution must:
Validate incoming request data and return results immediately to the caller.
Support Microsoft Entra ID authentication.
Scale automatically under variable load.
You need to implement a trigger.
Which trigger should you implement?
Show answerHide answer

Correct answer: A HTTP

Explanation

Explanation

The HTTP trigger is the only option that satisfies all the requirements for this scenario:

Validate incoming request data and return results immediately to the caller: The HTTP trigger allows an Azure Function to act as a RESTful API. It receives the HTTP request payload (which you can validate in code) and returns an HTTP response synchronously to the client.

Support Microsoft Entra ID authentication: HTTP-triggered functions can be easily secured using App Service Authentication (Easy Auth), which supports Microsoft Entra ID (formerly Azure AD) out of the box for validating bearer tokens.

Scale automatically under variable load: When hosted on the Consumption or Premium plans, HTTP-triggered functions automatically scale out based on incoming request volumes.

Why the Other Options Are Incorrect

B. Azure Queue storage: This is an asynchronous, background processing trigger. It does not accept public HTTP requests and cannot return an immediate response to a caller.

C. Azure Event Grid: This is an event-driven trigger designed to react to state changes in Azure resources. It does not expose a public HTTP API endpoint for clients to submit requests.

D. Service Bus topic: Similar to a queue, this is used for asynchronous message brokering. It is not designed to act as a public-facing API endpoint for synchronous requests.

References

Microsoft Learn: Azure Functions HTTP trigger (Details on returning HTTP responses and authentication).
Question 28
You are developing a Python application that reads data from Azure Cosmos DB for NoSQL by using the azure-cosmos SDK.
You need to connect to an existing account and run a SQL query against an existing container.
Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Show answerHide answer

Explanation



Explanation

1. Initialize CosmosClient: The first step in any Cosmos DB Python application is to create an instance of CosmosClient. This requires your account endpoint URI and credential (like a key or managed identity) to establish a connection to the Cosmos DB account.

2. Specify the database name: Once the client is initialized, you must access the specific database that contains your data by using a method like client.get_database_client("database_name").

3. Obtain the container reference: After targeting the database, you need to get a reference to the specific container (collection) you want to query using a method like database.get_container_client("container_name").

4. Run the query: With the container reference established, you can finally execute your SQL query using methods like container.query_items(query="SELECT * FROM c", enable_cross_partition_query=True) to retrieve the data.

Why the Other Option Is Incorrect

Initialize DatabaseProxy: DatabaseProxy is an internal class within the SDK. As a developer, you do not instantiate this directly; it is automatically created and returned when you call get_database_client() during step 2.

References

Microsoft Learn: Quickstart: Azure Cosmos DB for NoSQL client library for Python
Question 29 Choose 1
You are training a Language Understanding model for a user support system.
You create the first intent named GetContactDetails and add 200 examples.
You need to decrease the likelihood of a false positive.
What should you do?
Show answerHide answer

Correct answer: D Add examples to the None intent.

Explanation

Explanation

In conversational AI (specifically using Azure AI Language Conversational Language Understanding - CLU, or the older LUIS), a false positive occurs when the system incorrectly matches a user's utterance to a specific intent (like GetContactDetails) when it should not have.

To decrease the likelihood of this, you must train the model on what it should ignore. The None intent is a catch-all for utterances that do not belong to any specific intent. By adding a variety of diverse examples to the None intent, you teach the model to distinguish between valid GetContactDetails requests and general chatter or off-topic questions that should not trigger the intent.

Why the Other Options Are Incorrect

A. Enable active learning: Active learning helps improve model accuracy over time by flagging ambiguous utterances from real user traffic for review. However, it is a reactive, long-term process and does not immediately solve the current problem of false positives during initial training.

B. Add a machine learned entity: Entities extract specific data (like dates or names) from within an utterance. They do not determine the overall intent of the utterance and will not prevent false positive intent matches.

C. Add additional examples to the GetContactDetails intent: Adding more examples to the target intent will help the model better recognize true positives (recall), but it will not help it recognize what is not that intent. It can even increase false positives if the examples share too many linguistic similarities with off-topic queries.

References

Microsoft Learn: None intent in conversational language understanding (Explains the role of the None intent in preventing false positives).
Question 30
You are developing an Azure Functions app.
All functions in the app meet the following requirements:
Run until either a successful run or until 10 run attempts occur.
Ensure that there are at least 20 seconds between attempts for up to 15 minutes.
You need to configure the host.json file.
How should you complete the code segment? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

When initializing Azure SDK clients, you must instantiate a credential object and pass it to the service client.

ManagedIdentityCredential is selected for the credential variable because it strictly enforces the use of an Azure Managed Identity. When an application is hosted in Azure (like Azure Functions or App Service), this credential securely authenticates to the target service without requiring secrets or connection strings, ensuring a highly secure, zero-trust connection.

DefaultAzureCredential is selected to initialize the client object. It is a best practice for Azure applications because it provides a seamless authentication chain. It automatically attempts various authentication methods (such as Environment variables, Workload Identity, and Managed Identity) in a specific order. This allows the code to run locally using a developer's Visual Studio or CLI credentials, and then seamlessly transition to using the assigned Managed Identity when deployed to Azure, without any code changes.

Why Other Options Are Incorrect

ChainedTokenCredential: This allows developers to define a custom sequence of credentials. While useful in complex scenarios, it is not required here, as DefaultAzureCredential already provides a built-in chain.

AddAzureAppConfiguration: This is not a credential type. It is an extension method used to load configuration settings from Azure App Configuration into a .NET application, not for authenticating to services.

References

Microsoft Learn: Managed identity in Azure Functions
Full mock exam

Sit the AI-200 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real AI-200 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full AI-200 mock exam
  • 60questions per mock
  • 120 mintime limit
  • 142questions in the bank
  • Newmock on every attempt