Forum Discussion
Azure Event Grid with ASB
Hi,
we need to push Event Grid events for blob creation to an Azure Service Bis queue to deduplicate as the EG guarantee "At least one delivery" pattern, but the problem is that we need to deduplicate with blob name as "MessageId" on ASB side. The problem is that the blob name is not present in the event data. we have only "subject" with the full url that can exceed 128 characters, the limit of ASb Messageid.
In some duplicate events I found that the filed "data/storageDiagnostics/batchId" is the same for duplicated events. I'm wonderring if this batchId will be always the same for duplicate events, I can use it as "MessagesId" in "Delivery properties"
1 Reply
Hi, for deduplication with Service Bus, the important part is controlling the MessageId. Event Grid can deliver at least once, so I would route the event through an Azure Function or Logic App and set the Service Bus MessageId to something stable, such as storage account, container, blob path, and eTag. Then enable duplicate detection on the queue or topic with a window that matches your retry pattern.