Storage Account Replication Monitoring

Anon4343 451 Reputation points
2022-04-19T14:58:25.303+00:00

How would we go about being notified that storage account replication is failing or has excessive delays? I see that it's possible to query the date time stamp via powershell, but how do we translate that into an emailed alert?

$lastSyncTime = $(Get-AzStorageAccount -ResourceGroupName <resource-group> -Name <storage-account>
-IncludeGeoReplicationStats).GeoReplicationStats.LastSyncTime

https://learn.microsoft.com/en-us/azure/storage/common/last-sync-time-get?tabs=azure-powershell

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,936 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,833 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andrew Blumhardt 9,676 Reputation points Microsoft Employee
    2022-04-22T14:34:25.877+00:00

    To your point, a simpler solution would be to use Azure Monitor Metrics. Though I do not see replication as a metric at a glance. If this does not work you might try adding it as a custom metric in diagnostic settings. Also, this could be run as an automation runbook or possibly a logic app to log the output or send as an email.

    https://learn.microsoft.com/en-us/azure/storage/common/storage-monitoring-diagnosing-troubleshooting?tabs=dotnet#monitoring-performance
    https://learn.microsoft.com/en-us/azure/storage/common/storage-insights-overview
    https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-metric

    1 person found this answer helpful.
    0 comments No comments

  2. David Broggy 5,701 Reputation points MVP
    2022-04-22T06:39:42.24+00:00

    I would do it in azure sentinel. you can create a kql query and generate an alert based on any threshold.