SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
AI-200 · Domain 3

Connect to and consume Azure services practice questions

Connect to and consume Azure services is worth 24% of the AI-200 exam — the 2nd-heaviest of the 4 domains. Messaging and serverless: Azure Service Bus queues, topics, subscriptions and dead-lettering, Azure Event Grid filters, custom events and retries, and Azure Functions triggers, bindings, configuration and deployment. Official weighting 20–25%. 6 fully worked examples are further down this page, answers included.

Exam weight
24%
the 2nd-heaviest of the 4 domains
Questions
96
across 2 topics
Free, no account
5/day
a free account allows 10 a day
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

Mode

Ready when you are

10 fresh questions drawn across 1 of 4 domains, in Learn mode.

Review what you missed

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Connect to and consume Azure services questions, fully explained

Questions from the AI-200 bank mapped to domain 3, with the answer key and the reasoning behind every option. None of them repeat the examples on the main AI-200 practice page.

Question 1Connect to and consume Azure services

An order service publishes each order once to Azure Service Bus. A fraud-scoring model service and a recommendation service must each receive every order, and either one can be offline for an hour without losing orders. When a third consumer is added later, the order service must not change. What should the developer create?

Choose one.

  • a
    A Service Bus queue that both consuming services receive messages from

    Two receivers on one queue are competing consumers: each order would reach only one of the two services.

  • b
    Two Service Bus queues, with the order service sending each order to both

    This delivers to both today, but a third consumer would need the order service to send to a third queue, which breaks the stated requirement.

  • c
    A Service Bus topic with one subscription for each consuming service Correct

    Each subscription receives its own copy of every message and stores it independently, and adding a consumer means adding a subscription only.

  • d
    A Service Bus queue with sessions enabled and one session for each service

    Sessions group related messages for ordered processing by one receiver; they do not copy a message to several consumers.

The concept

Topics and subscriptions are Service Bus publish/subscribe: every subscription gets a copy of each message.

Why that’s the answer

A queue gives each message to one receiver. A topic forwards every message to each of its subscriptions, which behave like independent queues, so each service keeps its own backlog while offline. New consumers only need a new subscription, so the publisher is unchanged. Sending to several queues works only until a new consumer arrives, and sessions are about ordering, not fan-out.

How to reason it out
  1. Every consumer needs every message, so this is publish/subscribe.
  2. Each consumer must buffer while offline, which a subscription does.
  3. Adding consumers without touching the sender rules out sender-side fan-out.

Exam tip: One receiver per message: queue. Every consumer gets a copy: topic plus one subscription per consumer.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

Question 2Connect to and consume Azure services

A Python worker receives messages from a Service Bus queue in peek-lock mode and calls a model that can take up to 12 minutes per message. The queue's lock duration is 1 minute. Logs show MessageLockLostError when the worker calls complete_message, and some messages are processed twice. No message may be lost if the worker crashes mid-processing. What should the developer do?

Choose one.

  • a
    Register each received message with an AutoLockRenewer for 15 minutes Correct

    AutoLockRenewer keeps renewing the message lock in the background, so the lock survives 12 minutes of processing and the message stays recoverable if the worker crashes.

  • b
    Raise the queue's lock duration to its maximum number of minutes

    The maximum lock duration is 5 minutes, which is still shorter than 12 minutes of processing, so locks would keep expiring.

  • c
    Receive each message with ServiceBusReceiveMode.RECEIVE_AND_DELETE

    Receive-and-delete removes the message on receipt, so a crash mid-processing loses it, breaking the stated requirement.

  • d
    Raise the maximum delivery count so each received message is retried more

    The delivery count limits retries before dead-lettering; it does not stop the lock from expiring, so duplicates and lock-lost errors continue.

The concept

In peek-lock mode the lock must outlast processing; long work renews the lock rather than relying on a longer lock duration.

Why that’s the answer

The lock expires after 1 minute, so the message becomes visible again, another receiver processes it (duplicates), and the original receiver's complete_message fails with MessageLockLostError. The lock duration can be raised only to 5 minutes, still short of 12. AutoLockRenewer (or renew_message_lock) extends the lock for as long as processing needs while keeping peek-lock's crash safety. Receive-and-delete would lose messages on a crash, and the delivery count does not affect lock expiry.

How to reason it out
  1. Diagnose: lock-lost on complete plus duplicates means the lock expired mid-processing.
  2. Recall the 5-minute maximum lock duration, which rules out simply raising it.
  3. Keep peek-lock for crash safety and renew the lock in the background.

Exam tip: Processing longer than the 5-minute lock maximum needs lock renewal (AutoLockRenewer), not receive-and-delete.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

Question 3Connect to and consume Azure services

A Python worker receives a Service Bus message in peek-lock mode and then gets a transient 429 from a downstream Azure OpenAI deployment. The message should become available again right away to any worker instance, and the attempt should count toward the queue's maximum delivery count. Which receiver method should the worker call?

Choose one.

  • a
    receiver.defer_message(msg)

    Defer sets the message aside; it can then only be received by sequence number with receive_deferred_messages, not by the next worker.

  • b
    receiver.abandon_message(msg) Correct

    Abandon releases the lock immediately so any receiver can take the message again, and it increments the delivery count.

  • c
    receiver.complete_message(msg)

    Complete deletes the message from the queue, so the work would never be retried.

  • d
    receiver.dead_letter_message(msg)

    Dead-lettering moves the message to the dead-letter subqueue, where normal receivers never see it.

The concept

Peek-lock settlement methods decide what happens next to a message: complete, abandon, defer or dead-letter.

Why that’s the answer

abandon_message gives up the lock at once, so the message returns to the queue for any receiver, and the delivery count goes up; after the maximum delivery count the broker dead-letters it. Completing removes it, deferring hides it until it is fetched by sequence number, and dead-lettering moves it out of normal processing.

How to reason it out
  1. The failure is transient, so the message should be retried.
  2. Retry by any worker, now, means returning the message to the queue.
  3. Abandon does that and counts toward the delivery limit.

Exam tip: abandon = try again now (counts toward max delivery); defer = set aside for later lookup by sequence number.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

Question 4Connect to and consume Azure services

A workflow worker receives a 'publish summary' message from a Service Bus queue before the matching 'summary approved' message has been processed. The worker must set this exact message aside, keep it out of normal receives, and fetch it again only when the approval arrives, at a time nobody can predict. What should the worker do?

Choose one.

  • a
    Call defer_message and later receive it with receive_deferred_messages by its sequence number Correct

    Deferral keeps the message in the queue but hidden from normal receives until it is fetched by sequence number, whenever the approval arrives.

  • b
    Call abandon_message and let the broker redeliver it until the approval has been processed

    Abandoned messages are redelivered immediately, which loops and raises the delivery count until the message is dead-lettered.

  • c
    Send a copy with schedule_messages for five minutes later and complete the original message

    Scheduling needs a known enqueue time; the approval time is unpredictable, so the copy may arrive too early again.

  • d
    Call dead_letter_message and later read it back from the dead-letter subqueue by its message ID

    The dead-letter subqueue is for messages that cannot be processed, and receivers cannot look up a dead-lettered message by ID.

The concept

Message deferral sets a received message aside so the application can retrieve that specific message later by its sequence number.

Why that’s the answer

defer_message leaves the message in the queue in a deferred state; it is no longer returned by ordinary receives, and the application keeps the sequence number to call receive_deferred_messages when the prerequisite completes. Abandon redelivers at once, scheduling requires knowing the time in advance, and the dead-letter queue is for failed messages, not for parking work.

How to reason it out
  1. The message must be kept but hidden, then fetched on demand.
  2. The time is unknown, which rules out scheduling.
  3. Deferral plus the saved sequence number gives on-demand retrieval.

Exam tip: Unknown 'later' for a specific message: defer it and keep its sequence number; known 'later': schedule it.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

Question 5Connect to and consume Azure services

A developer writes a Python job that reads messages the broker has moved out of the 'inference-jobs' queue after too many failed deliveries, logs why each failed, and removes it.with client.get_queue_receiver( "inference-jobs", ____________________) as receiver: for msg in receiver.receive_messages(max_wait_time=5): print(msg.dead_letter_reason) receiver.complete_message(msg)Which argument completes the code?

Choose one.

  • a
    sub_queue=ServiceBusSubQueue.DEAD_LETTER Correct

    This targets the queue's dead-letter subqueue, where messages that exceeded the maximum delivery count are held.

  • b
    sub_queue=ServiceBusSubQueue.TRANSFER_DEAD_LETTER

    The transfer dead-letter subqueue holds messages that failed auto-forwarding or send-via, not messages that exceeded the delivery count.

  • c
    receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE

    This reads the main queue, not the dead-letter subqueue, and messages would be deleted on receipt, so complete_message would fail.

  • d
    session_id=NEXT_AVAILABLE_SESSION

    This accepts a session on a session-enabled queue; it does not address the dead-letter subqueue.

The concept

Each queue and subscription has a dead-letter subqueue; the Python SDK reaches it with sub_queue=ServiceBusSubQueue.DEAD_LETTER.

Why that’s the answer

Messages that exceed the maximum delivery count are moved to the entity's dead-letter subqueue with the reason MaxDeliveryCountExceeded. In azure-servicebus you create a receiver for the same queue (or subscription) and pass sub_queue=ServiceBusSubQueue.DEAD_LETTER; messages there are read and completed like any others and stay until you remove them. TRANSFER_DEAD_LETTER is a different subqueue for failed forwarding, and the other arguments read the main queue.

How to reason it out
  1. Identify where over-delivered messages go: the dead-letter subqueue.
  2. Recall the SDK addresses subqueues with the sub_queue argument.
  3. Pick DEAD_LETTER rather than TRANSFER_DEAD_LETTER, which is only for forwarding failures.

Exam tip: Python: get_queue_receiver(queue, sub_queue=ServiceBusSubQueue.DEAD_LETTER) reads the DLQ; complete each message to remove it.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

Question 6Connect to and consume Azure services

A Service Bus queue of embedding jobs has a one-hour message time-to-live. During an outage, jobs that waited longer than an hour disappeared without trace. The team needs expired jobs kept for review and then reprocessed after the workers recover, without changing how senders set time-to-live. Which two actions should the team take? (Select TWO.)

Choose TWO.

  • a
    Raise the queue's maximum delivery count so that expired messages are kept for longer

    The delivery count limits failed deliveries; it has no effect on time-to-live expiry.

  • b
    Set a time-to-live on the dead-letter subqueue so reprocessed jobs are purged after review

    The dead-letter subqueue does not observe time-to-live and has no automatic cleanup; messages stay until they are completed.

  • c
    Enable dead-lettering on message expiration for the queue Correct

    With this setting, expired messages move to the dead-letter subqueue with reason TTLExpiredException instead of being dropped.

  • d
    Run a job that resends each dead-lettered job to the queue and then completes the copy Correct

    Dead-lettered messages stay until something removes them, so a reprocessing job must resend them and complete the copies.

  • e
    Have the workers defer messages during outages so they are kept past their time-to-live

    Workers are down during the outage, so they cannot defer anything, and deferring is not a way to survive expiry in an outage.

The concept

Expired Service Bus messages are dropped unless dead-lettering on expiration is enabled, and the dead-letter subqueue is never cleaned automatically.

Why that’s the answer

By default an expired message is simply removed. Enabling dead-lettering on message expiration moves it to the dead-letter subqueue with the reason TTLExpiredException. Messages there do not expire and are not cleaned up, so recovery needs code (or Service Bus Explorer) that reads them, resends them to the main queue and completes the dead-lettered copies. Delivery count does not affect expiry, and a TTL on the DLQ does not exist.

How to reason it out
  1. First fact: expiry drops messages unless dead-lettering on expiration is on.
  2. Second fact: the DLQ keeps messages indefinitely; reprocessing is your job.
  3. Discard options that confuse delivery count, or that rely on DLQ expiry.

Exam tip: To keep expired messages, enable dead-lettering on expiration; to reprocess them, resend and complete from the DLQ yourself.

AI-200 Service Bus and Event Grid: Messaging and Event-Driven AI Solutions — the lesson that teaches this.

What AI-200 domain 3 tests, topic by topic

The official exam guide breaks Connect to and consume Azure services into 2 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published AI-200 practice questions per topic in Connect to and consume Azure services
TopicWhat it coversQuestions
Develop event- and message-based AI solutionsSkills outline section (AI-200, study guide dated April 15, 2026). Queue and process back-end operations by using Azure Service Bus, including dead-letter queue handling, messages, topics, and subscriptions; Implement event-driven workflows by using Azure Event Grid, including filters, custom events, and retries.48
Develop and implement Azure FunctionsSkills outline section (AI-200, study guide dated April 15, 2026). Build serverless APIs, including implementing triggers and bindings; Configure and deploy function apps.48
Total96

Revise Connect to and consume Azure services before you drill it

Other AI-200 domains

Connect to and consume Azure services: your questions

Connect to and consume Azure services is domain 3 of the AI-200 exam guide and carries 24% of the scored content — the 2nd-heaviest of the 4 domains. On a 50-question paper that works out to roughly 12 questions, though Microsoft Azure does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official AI-200 exam guide.