The Service Bus Stats is a small widget that provides a sneak peak into a service bus entity's stats.
How-to
Follow the below steps to add and configure the widget.
Add the widget to the dashboard where needed.
On the widget's menu, click on Configure.
Give the widget a title.
Specify the service bus namespace.
Specify the Shared Access Key Name, otherwise known as a policy name.
Shared Access Keys can be found on the Service Bus configuration page in Azure under Settings.
Enter the policy secre in the Shared Access Key field.
Select the Entity Type.
Currently, only service bus queues are supported.
Finally, specify the entity name. That is the name given to each queue or topic.
Security Considerations
In order for the widget to be able to access the service bus api, a shared access policy with the Manage right is needed.
To reduce the security risk associated with using a Manage policy. Declare a new policy at the lowest possible level on the service bus. That is create a policy at the queue or topic level and not at the namespace level.
Retrieving service bus statistics directly from the widget is currently unsupported, due to the lack of CORS implementation within the service bus API. The widget, therefore, sends requests to a proxy service, which in turn, queries the service bus API. The service bus key is NOT sent directly to the external proxy service. Instead, a token with a limited lifetime is generated within the widget, which in turn, is sent to the proxy service for stats retrieval.