AI-200 · Sample questions
AI-200 sample questions with answers and explanations
10 real questions from the CertifyDeck AI-200 bank, spread across the domains of the official Microsoft Certified: Azure AI Cloud Developer Associate skills outline, with the correct answer and a full explanation of why the other options are wrong. They are original questions written from the public syllabus, not exam dumps, and they are the same style you will find in the practice tests and mock exams.
- Question 1Domain: Develop containerized solutions on AzureMedium
After you deploy a custom container to Azure App Service, its logs show that the app tried to connect to Azure Database for PostgreSQL by using the literal string @Microsoft.KeyVault(SecretUri=https://kv-ops.vault.azure.net/secrets/pg-pass) as the password. What is the most likely cause?
- A.Key Vault references are supported only in connection strings, not in app settings.
- B.Custom containers receive app settings only after they are mapped in the Dockerfile with ENV.
- C.References without a secret version stay unresolved until the secret is rotated for the first time.
- D.The app identity lacks permission to read the secret, so the reference wasn't resolved.
Show answer and explanation
Correct answer: D. The app identity lacks permission to read the secret, so the reference wasn't resolved.
Explanation
When a Key Vault reference can't be resolved, App Service passes the reference string itself to the app, and the most common cause is missing access for the app identity, although a deleted secret or a syntax error can also cause it. References work in both app settings and connection strings. App settings are injected as environment variables without any Dockerfile change, and an unversioned reference resolves to the latest version.
Official references
- Question 2Domain: Develop containerized solutions on AzureMedium
You run a Bash script in Azure Cloud Shell that must sign in to registry myreg with helm registry login by using your own Microsoft Entra identity. Cloud Shell provides the Docker CLI but doesn't run the Docker daemon, no other container tool is installed, and az acr login fails. What should you do?
- A.Set the DOCKER_COMMAND environment variable to podman before you run az acr login.
- B.Run az acr login --expose-token and use the returned access token as the password.
- C.Enable the admin user with az acr update --admin-enabled true and use its password.
- D.Create a token with az acr token create and sign in with one of its two generated passwords.
Show answer and explanation
Correct answer: B. Run az acr login --expose-token and use the returned access token as the password.
Explanation
When the Docker daemon isn't running, az acr login --expose-token returns a Microsoft Entra access token that you pass as the password, with the documented all-zero GUID as user name, to docker login or helm registry login. The admin user and repository-scoped tokens aren't Microsoft Entra identities, so they don't meet the requirement. DOCKER_COMMAND only switches to another installed container tool, and none is installed.
Official references
- Question 3Domain: Develop containerized solutions on AzureMedium
You use blue-green deployment for a container app in multiple revision mode. The labels blue and green point to the current and the new revision, and blue receives all production traffic. After testing the green label URL, you must move all production traffic to green while keeping blue available for a quick rollback. Which command should you run?
- A.az containerapp revision set-mode --mode single
- B.az containerapp revision deactivate --revision <blue revision>
- C.az containerapp revision label add --label green --revision <new revision>
- D.az containerapp ingress traffic set --label-weight blue=0 green=100
Show answer and explanation
Correct answer: D. az containerapp ingress traffic set --label-weight blue=0 green=100
Explanation
The --label-weight parameter of az containerapp ingress traffic set assigns traffic weights by revision label, so setting green to 100 and blue to 0 moves production traffic while the blue revision stays active for a rollback with the opposite weights. Deactivating the blue revision or switching to single mode removes the old revision from service, which fails the quick rollback requirement, and adding the green label again changes no traffic weights.
Official references
- Question 4Domain: Connect to and consume Azure servicesEasy
Your order intake API publishes an OrderPlaced message to Azure Service Bus once per order. A billing worker, a shipping worker and a recommendation-model trainer must each receive their own copy of every message and process it independently. The API must keep sending each message only once. Which design should you use?
- A.One session-enabled queue with a session ID per worker
- B.One queue that the three workers read as competing consumers
- C.One topic with a separate subscription for each worker
- D.One queue per worker, each with duplicate detection enabled
Show answer and explanation
Correct answer: C. One topic with a separate subscription for each worker
Explanation
Topics provide one-to-many publish/subscribe delivery: each subscription acts like a virtual queue that receives a copy of every message sent to the topic. With a single queue, each message is processed by only one competing consumer. Sessions or one queue per worker would force the API to send the message several times, which breaks the send-once requirement.
Official references
- Question 5Domain: Connect to and consume Azure servicesMedium
A Python producer sends scoring requests to a Service Bus queue that has duplicate detection enabled. After a network timeout the producer resends the same request, and the queue ends up holding two copies. Each send creates ServiceBusMessage(body) and sets no other properties. What should you change?
- A.Set each message's session ID to a value derived from the request ID.
- B.Set each message's MessageId to a value derived from the request ID.
- C.Lengthen the duplicate detection history window of the queue.
- D.Have consumers receive in receive-and-delete mode instead of peek-lock.
Show answer and explanation
Correct answer: B. Set each message's MessageId to a value derived from the request ID.
Explanation
Duplicate detection compares only the application-controlled MessageId against the IDs logged during the history window, so the producer must set a MessageId that can be reconstructed from the business request. Without it, each send gets a different identifier and no duplicate is found, however long the window is. The session ID and the consumers' receive mode play no part in deduplication.
Official references
- Question 6Domain: Secure, monitor, and troubleshoot Azure solutionsMedium
A compliance rule says that a deleted secret in your vault must stay recoverable for the full retention period, and that nobody, including subscription owners, may permanently remove it before that period ends. Soft-delete is already enabled. What should you do?
- A.Enable purge protection on the vault
- B.Switch the vault to the access policy permission model
- C.Remove every Key Vault Purge Operator role assignment
- D.Grant the application identities only Key Vault Reader
Show answer and explanation
Correct answer: A. Enable purge protection on the vault
Explanation
With purge protection on, a vault or object in the deleted state can't be purged until the retention period passes, while it can still be recovered. Removing Purge Operator assignments doesn't stop a subscription owner, who can purge in general. Changing the permission model or the application roles doesn't block purge operations.
Official references
- Question 7Domain: Secure, monitor, and troubleshoot Azure solutionsMedium
Your Azure function writes trace messages such as 'PaymentGatewayTimeoutError for order 5512' to the AppTraces table. A colleague runs AppTraces | where Message has 'Timeout' and gets no rows, although those messages exist in the selected time range. What is the cause?
- A.The has operator is case-sensitive and the casing of the stored value differs
- B.The has operator matches whole terms, and Timeout is part of a longer term
- C.The has operator needs has_any with a list of values to match a single word
- D.The has operator only checks whether the value starts with the given string
Show answer and explanation
Correct answer: B. The has operator matches whole terms, and Timeout is part of a longer term
Explanation
KQL splits strings into terms, which are maximal sequences of alphanumeric characters, and has looks for a whole term; PaymentGatewayTimeoutError is one term, so has 'Timeout' is false while contains 'Timeout' would be true. The case-sensitivity explanation is wrong because has is case-insensitive (has_cs is the case-sensitive form), and checking the start of a value is what startswith does.
Official references
- Question 8Domain: Develop AI solutions by using Azure data management servicesMedium
A cleanup script deletes discontinued products from an Azure Cosmos DB for NoSQL container partitioned by /category. It runs for item in container.query_items(query, enable_cross_partition_query=True): container.delete_item(item, partition_key="/category"). Every delete fails although the query returns the items. What is the cause?
- A.The query must be run with partition_key instead of cross-partition.
- B.partition_key must be the item's category value, not the key path.
- C.delete_item needs the item id string, not the item dictionary.
- D.Items must be removed with a SQL DELETE statement in query_items.
Show answer and explanation
Correct answer: B. partition_key must be the item's category value, not the key path.
Explanation
For point reads and deletes in a partitioned container, the partition_key argument must be the value of the partition key for that particular item, such as item["category"], not the name or path of the partition key property. delete_item accepts the item dictionary, as the SDK sample shows, and the API for NoSQL doesn't support a SQL DELETE statement. Running the query cross-partition is valid for finding the items.
Official references
- Question 9Domain: Develop AI solutions by using Azure data management servicesMedium
A developer runs this command against a valid vector index in Azure Managed Redis: FT.SEARCH docs-idx '*=>[KNN 5 @embedding $vec]' PARAMS 2 vec <blob>. The blob matches the field's type and dimensions, but the server rejects the query. What should the developer change?
- A.Append LIMIT 0 5 to the command.
- B.Append SORTBY __embedding_score to the command.
- C.Replace the * filter with an @embedding filter.
- D.Append DIALECT 2 to the command.
Show answer and explanation
Correct answer: D. Append DIALECT 2 to the command.
Explanation
To issue a vector search query with FT.SEARCH, the DIALECT option must be set to 2 or higher, so the command needs DIALECT 2. SORTBY on the distance field only changes ordering and LIMIT only changes how many results come back; neither makes the KNN syntax valid. The * primary filter is the documented way to say that no metadata filter is needed.
Official references
- Question 10Domain: Develop AI solutions by using Azure data management servicesEasy
You are building a Python recommendation service over roughly 40,000 product embeddings stored in Azure Managed Redis. Product managers require that each query returns the exact nearest vectors, never an approximation, and the dataset is small enough for latency to stay acceptable. Which vector index algorithm should you declare in FT.CREATE?
- A.HNSW with a high M value
- B.HNSW with EF_RUNTIME raised at query time
- C.HNSW with a high EF_CONSTRUCTION value
- D.FLAT
Show answer and explanation
Correct answer: D. FLAT
Explanation
FLAT is an exact brute-force index suited to smaller datasets or workloads that need exhaustive search, so it always returns the true nearest neighbours. HNSW is an approximate nearest-neighbour algorithm: raising M, EF_CONSTRUCTION or EF_RUNTIME improves accuracy but never guarantees exact results, which fails the stated requirement.
Official references
How to use these AI-200 sample questions
Answer each question before opening the explanation, and write down why you discarded the other options. On AI-200, most mistakes come from choosing an option that is technically possible but does not meet every requirement in the scenario.
These 10 questions are a taste of the format, not a diagnostic. To know which domains you fail, practice by domain for free and take a timed mock exam that mirrors the official weights and duration.
Practice AI-200 with hundreds more questions
Start for free, no sign-up or card. Every question includes an explanation like the ones above, and the mock exam reproduces the official AI-200 format.