Am planning to develop an powershell script to delete DLQ messages under Azure servicebus topic subscription, however i could not find any powershell cmdlet to delete the DLQ messages and when i referred some documents it says its not possible to delete the DLQ messages via powershell as it doesnt have any right cmdlet to delete it , so i tried lets try with Restapi method but i couldnt find accurate restapi. So I have these question
- Can i use powershell script to delete dlq messages? or
- Which Restapi can i use for it .
Any suggestion on this is much apprciated. Am eager to write powershell scriot but want to know is it possible ? Please note : Am not expert in ps script but i write some basic scripts
Thanks in Advace
There is no possibility of using PowerShell script to delete dql messages.
Refer Microsoft Q&A for detailed information on the above approach.
You can use the Rest API with URL
https://<serviceNamespace>.servicebus.windows.net/<queuePath>/messages/headfor Delete request as given in the MS Doc.Or
You can also use
service bus explorerunder Azure service bus from the Portal as shown.Refer SO by @Thili for another approach which is using service bus explorer tool to deleted dlq messages.