Apart from sys.dm_geo_replication_link_status to monitor Auto-Failover group . are there any metric from Azure monitoring or Azure sql diagnostic to reflect these information?
Apart from sys.dm_geo_replication_link_status to monitor Auto-Failover group . are there any metric from Azure monitoring or Azure sql diagnostic to reflect these information?
Hi @sakuraime,
Thanks for using Microsoft Q&A !!
There are two ways you can get this information -
Using Az SQL Powershell cmdlet (Get-AzSqlDatabaseReplicationLink)
Get-AzSqlDatabaseReplicationLink -DatabaseName {Datbase Name} -PartnerResourceGroupName {Secondary Resource Group Name} -ResourceGroupName {Primary Resource Group Name} -ServerName {Server Name}
You will be getting the results like below - 
Using Replication Links Rest API (List By Database/List by Server)
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks?api-version=2021-02-01-preview
Results -
Please let me know if you have any other questions.
Thanks
Saurabh
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.
thanks .pretty good , but from tsql it's actually in second measuring the lag .
however in here using powershell or restAPI , it show the percentage......... sounds percentage is quite hard to transfer to seconds.......
Hi @sakuraime,
I agree. Could you please help me with the actual use case of getting the geo replication status using other method than existing (sys.dm_geo_replication_link_status) and I will be providing this feedback internally to products team.
I also suggest you to provide your feedback over uservoice as well.
Thanks
Saurabh
Hi @sakuraime,
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.
Thanks
Saurabh
8 people are following this question.