0
votes

Currently we use Service Bus Explorer to connect to our Service Bus Namespace and manage our dead letters. However as this is a third party tool it's been asked that we do not use this anymore as there is a lot of sensitive data being pulled from the dead letters.

We do not get many dead letter messages in the queues so we thought it would be great if we can view the payload of a dead letter directly in Azure CLI or Powershell. I have looked around online and can't seem to find anything in regards to viewing payloads in CLI. Everything seems to recommend using Service Bus Explorer for viewing payloads.

Any help on this would be greatly appreciated.

2
If you are very much concerned about privacy then I would highly suggest using Serverless360 which is compliant to GDPR and also you got a private Hosting option that can be deployed to your own environment using your own databases.Nadeem Duke

2 Answers

2
votes

Azure CLI for Service Bus is intended to manage service namespace, entities, and control plane (authorization rules, Geo-DR, namespace migration, etc). It is not intended for the data plane. Just as you wouldn't do expect a DB (MariaDB) to provide commands for data manipulation.

You've got two options:

  1. Use a tool
  2. Write custom script/code (which is a way of building a custom tool)

For tooling, you've got a few options: ServiceBus Explorer (free), QueueExplorer (paid), Serverless360 (subscription), etc.

If you choose to write your own code, you could use PowerShell and leverage .NET SDK. Or create your own project/tool to help you inspect and move those dead-lettered messages.

Remember that operating on messages in a dead-letter queue is no different from consuming messages from a regular queue/subscription. It's the path that is slightly different. There's the official documentation on the topic as well as some more extended information on the web. I've posted a few blog posts that could help you work with dead-letter queues more effectively:

If you're using NServiceBus with Azure ServiceBus, you can leverage Service Pulse to achieve monitoring and inspection with a custom plugin. Here's a post.

For a pure code solution, this sample could be a good starting point.

0
votes

Looking at both latest Azure PowerShell Cmdlets (v6.13.0) and Azure CLI, it seems that the functionality you're looking for is not available. The functionality available at both places are for managing Azure Service Bus control plane and not the data plane.

Regarding Service Bus Explorer, even though it's a 3rd party tool, it's an open source tool and you can see what exactly it does. Furthermore, it's a desktop tool so the tool directly communicates with your Service Bus.

However if using Service Bus Explorer is not an option, I guess you're left with writing code using any available SDKs.