You can use Azure Geo-Redundant Storage (GRS) to replicate a storage account to another Azure region. In the rare event of a catastrophic failure where the entire Azure region (with multiple zones) has an outage, you can fail over the storage account to the secondary region. Much like an Exchange geo-cluster. Failover is initiated manually.
The replicated copy in the secondary region, which is selected automatically by Azure when you set up the storage account, will not always be up-to-date. The LastSyncTime property of the storage account provide an indication of the lag, which can help you decide whether to fail over to the secondary region.
LastSyncTime is displayed in the storage account > properties > Geo-replication page, but it’s hidden away in the Failover blade. Click the Prepare for failover button to reveal it.
This PowerShell command displays the LastSyncTime.
(Get-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name> -IncludeGeoReplicationStats).GeoReplicationStats.LastSyncTime
You can omit the LastSyncTime to have display the two other properties – status and CanFailover.
(Get-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name> -IncludeGeoReplicationStats).GeoReplicationStats.LastSyncTime
If you use this frequently, add it as a function to your PowerShell profile. For example:
Function GRSStats {
(Get-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name> -IncludeGeoReplicationStats).GeoReplicationStats
}
{ 0 comments… add one now }