Alert on Storage Account queue count

149 Views Asked by At

I have tried for hours to find this answer.

I have a storage account, this account has about 50 queues setup in it. I need to monitor some of them and get an alert if the process that services them stops for any reason. So I want to know when a specific queue has more than X number of messages in it.

Using Monitor:Alerts seems to allow a signal for the entire storage account, but not a specific queue, which is useless.

I am open to 3rd party solutions if that is the only way to do this. I would rather not write a custom application to do it because that is just another point of failure.

Thanks in advance!

1

There are 1 best solutions below

1
RithwikBojja On BEST ANSWER

Using Alerts, yes you can monitor for entire storage account, if you want to monitor specific queue in that case you can alternatively use Azure Logic Apps, and below is the design which works for me:

Specify no of messages like below and you can send mail to outlook mail or gmail also and others also same as alerts with different connectors:

enter image description here

You can change 1 second and keep it as 1 hr or day as you wish from drop down. You can send to action group or sms with different connector.

Output:

enter image description here

enter image description here

Alternatively you can use log analytics workspaces. Send logs of queues to log analytics workspaces, set diagnostics settings as below :

enter image description here

and then save it:

enter image description here

Then you can check logs in log analytics workspace like below:

StorageQueueLogs  
| where OperationName contains "PutMessage" 
| where Uri contains "https://storageaccountname.queue.core.windows.net:443/queuename/messages?"
| count

enter image description here

Here https://storageaccountname.queue.core.windows.net:443/queuename/messages? contains queuename(only queues you want).

While creating alert you can set the threshold value.