Concept and mechanism
Service Bus separates receipt, processing, and settlement. With PeekLock, complete after persisting the necessary effect and prepare idempotency for lost settlement. A queue with competing consumers distributes work; a topic with subscriptions supports independent flows.
Duplicate detection compares MessageId within a window and does not turn external effects into exactly-once transactions. The DLQ retains work needing diagnosis, correction, and controlled reprocessing. Event Grid also requires consumers that tolerate duplicates and different ordering.
Subject or property filters select events; they do not replace endpoint authentication. Choose the service and pattern around the delivery and recovery contract the business needs.
Guided application
A Function has one trigger starting execution and can use bindings to integrate inputs and outputs. Permissions remain necessary. In Python, async def benefits from concurrency only when I/O does not block the event loop or is appropriately isolated.
For long work, persist the request in a queue or durable orchestration and return acceptance with queryable status; a local thread after the response can disappear with the host. In fictional processing, the result was saved but Complete failed.
On redelivery, check the business key and avoid repeating the effect. Retries should distinguish transient failures, respect budgets, and limit pressure. Define DLQ ownership, escalation timing, and how reconciliation is established before declaring the batch complete.
Persisted effect + lost Complete = possible redelivery. The business key allows recognizing the already applied operation.
Common pitfalls
Receipt as completion; broker deduplication as exactly once; empty DLQ achieved by deleting work; async with blocking I/O; 200 as durable work.
Related topics: Containers, artifacts, and revisions · Cosmos DB, vectors, and change feed · PostgreSQL, vectors, and caching
Separate acceptance, execution, and settlement with recovery and idempotent effects.
References
- Service Bus locks and settlement · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Dead-letter handling and diagnosis · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Queues topics and independent subscriptions · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- MessageId duplicate-detection window · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Event Grid delivery retries and ordering · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Event routing filters · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Functions triggers and bindings · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Python async and blocking I/O · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Functions reliable background work · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05
- Bounded retries and non-idempotent effects · Microsoft documentation accessed 2026-09-30; AI-200 guide updated 2026-05-05