How to trigger an alert when a message in Azure ServiceBus moves to DeadLetterQueue?

Hari Prathipati 0 Reputation points
2024-02-19T07:09:35.0433333+00:00

Hi there, I need to trigger an alert when a message in a topic is moved to the dead letter queue in Azure ServiceBus. I tried running this query on Azure Diagnostics table but it didn't return any results with the Category value as 'Deadletter' even though there are messages in the dead letter queue: AzureDiagnostics | where ResourceType == "SERVICEBUS" | where Category == "Deadletter" | where Message contains "moved to DeadLetter" Note: We are not looking for Count of dead-lettered messages in a Queue/Topic Could you please help me out with this? Thank you in advance. Regards, Hari

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
613 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 26,546 Reputation points
    2024-02-19T10:07:16.44+00:00

    @Hari Prathipati Thanks for reaching out. Currently it is not possible to create an alert when a message is dead-lettered in azure service Bus. you can create one that fires when you have messages in your Dead letter queue. You should then remove the message from the DLQ which will resolve the alert.

    Select Alerts and Alert rules in the Azure portal, click Count of dead-lettered messages in a Queue/Topic and create alert.

    Alternatively, you can create an Azure Function with a Service Bus trigger or a Logic App that is triggered when a message is dead-lettered and then configure the function or logic app to send an email or perform any other custom action that you want.

    do let me know incase of further queries, I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.