\> trigger alert when any queue in the storage has messages not processed
You used the “Queue Message Count” measure with the “Average” aggregation type.
To obtain the alert using the Log Analytics workspace and queue metrics, we can
enable the transaction by going to metrics and then enable storage read, write, delete under the Diagnostics settings by keeping destination as log analytics workspace.
To retrieve the unprocessed queue messages from storage, use the KQL query below.
\> trigger alert when any queue in the storage has messages not processed
You used the “Queue Message Count” measure with the “Average” aggregation type.
To obtain the alert using the Log Analytics workspace and queue metrics, we can
enable the transaction by going to metrics and then enable storage read, write, delete under the Diagnostics settings by keeping destination as log analytics workspace.
To retrieve the unprocessed queue messages from storage, use the KQL query below.
```kql
AzureMetrics
| where TimeGenerated > ago(7d)
| where MetricName == "QueueMessageCount"
| where Total > 0
| summarize Count=count() by bin(TimeGenerated, 1h), ResourceId
| where Count == X
| order by TimeGenerated desc
```
created the alert rule while utilizing the dynamic threshold.


Created the Action groups

The Alert had been triggered to the mail as I had connected to the Action group of the alerts

**References:**
[Create an Azure Monitor metric alert with dynamic thresholds - Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-dynamic-thresholds)
[Monitor Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/monitor-queue-storage?tabs=azure-portal)
created the alert rule while utilizing the dynamic threshold.


Created the Action groups

The Alert had been triggered to the mail as I had connected to the Action group of the alerts

**References:**
[Create an Azure Monitor metric alert with dynamic thresholds - Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-dynamic-thresholds)
[Monitor Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/monitor-queue-storage?tabs=azure-portal)