Azure Event Grid · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services

An Event Grid subscription invokes a payment-processing webhook. Because Event Grid provides at-least-once delivery, the same event can occasionally…

Practice question from Azure Event Grid (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.

hard · MCQ · Q-D4520A

An Event Grid subscription invokes a payment-processing webhook. Because Event Grid provides at-least-once delivery, the same event can occasionally be delivered more than once. The webhook must never charge a customer twice for the same event. Which design best addresses this requirement?

  1. A.Ignore duplicate deliveries because Event Grid guarantees exactly-once delivery
  2. B.Process only the first event received during each five-minute interval
  3. C.Use the Event Grid event.id as an idempotency key with the payment operation or a durable deduplication storeCorrect answer
  4. D.Return HTTP 500 for every event so Event Grid stops delivering duplicates

Solution

Event Grid can retry deliveries, so consumers must be idempotent. Persisting the event ID or passing it as an idempotency key to a payment provider lets the handler detect repeated deliveries without performing the charge again.

More from Azure Event Grid

All of Azure Event Grid

Practise more Connect to and Consume Azure and Third-party Services

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed