I am trying to enable dead-lettering to storage container when EventGrid fails to publish events to endpoint, but it is not dead-lettering events instead it is dropping the events. Below are the details:
- Storage Account: abcaccount
- Container: test
- Event Subscription: blob-created-event
- Endpoint Type: Service Bus Topic
- Service Bus Namespace: xyz-service-bus
- Topic Name: test-topic
- Dead Letter Storage Account: abcaccount
- Dead Letter Container: deadletters
To reproduce the failing scenario, I removed topic (test-topic) from service bus. and uploaded one blob to container (test) which in turn generated event and tried to publish event on service bus topic (test-topic), but after configured retry policy count (10) it dropped event, it should have dead-lettered in container (deadletters) in storage account (abcaccount).
When I enabled diagnostics, I observed NotFound error (the delivery endpoint not found)
Can someone help me please in this regards?
In Azure Event Grid, when events cannot be delivered to the configured endpoint (in your case, the nonexistent Service Bus Topic
test-topic), Event Grid should attempt to retry delivery according to the configured retry policy. Once the retry attempts are exhausted, Event Grid would typically drop the event, but it doesn't inherently support dead-lettering events to a Storage container.Create a function app and replace the below code to capture incoming events and store them in a Storage container.
Set-up the endpoint to trigger to the newly created Azure Function's URL
Trigger events that would normally be sent to your endpoint. Since your configured endpoint is the Azure Function, Event Grid will send events there.
Monitor the Azure Function logs to check that it captures and processes the incoming events.