azureazure-monitoring

Azure Metric Alert for multiple storage account with transactions as a signal


While creating an alert for a single storage account, I am able to see Transactions as a signal name. I was also able to successfully receive alerts based on that metric.

If I go back to the scope of the same alert and select all storage accounts under the same RG, I am not able to see Transactions as one of the signals. All I see is just custom log search and if you select See all signals, you would get bunch of administrative signal sources and some others but not the Transactions.

All resources and RG located in the same region.

I have done some research and some sources/links do not include storage accounts as fully capable to get single alerts to multiple resources, some articles mention that they should be able to.

How to set up a single alert based on transaction counts for multiple storage accounts within the same RG?


Solution

  • You can use the below KQL query to check the transaction operations across multiple storage accounts. The query will show the transaction count for resources over the last 30 minutes.

     AzureMetrics
    | where MetricName == "Transactions"
    | where TimeGenerated >= (now() - 30m)
    | summarize TotalTransactions = sum(Total) by Resource, bin(TimeGenerated, 30m)
    | order by TimeGenerated desc
    

    Output

    enter image description here

    This query will check the results every 30 minutes, and if the transaction limit is greater than 1 within 30 minutes, the alert will trigger automatically.

    enter image description here

    The alert is properly configured to trigger automatically based on the transaction count within the last 30 minutes

    enter image description here

    The alert was triggered successfully, and I received the email.

    enter image description here