Purge all messages from Azure Service Bus Queue
As I’m using Azure Service Bus as message queue, I got a need to clean all messages from a queue, that includes dead letters. I searched a little from the internet and the solution is quite laborious(Using Service Bus Explorer or a .NET code). That’s the reason that I chose to do it myself by calling Service Bus API, I think that will be much easier for use case. And I wrote a script for automation as well.
Just to be clear, this task in only for Service Bus queue. I think these steps are useful and I will summarize them including the details. Of…