I am trying to find the replication role of Azure SQL DB (Primary or Secondary).
I used : Get-AzureRmSqlDatabase command but could not find the replication information.
Is there a different powershell command to find replication role ?
I am trying to find the replication role of Azure SQL DB (Primary or Secondary).
I used : Get-AzureRmSqlDatabase command but could not find the replication information.
Is there a different powershell command to find replication role ?
On
The Get-AzureRMSqlDatabaseReplicationLink cmdlet replaces the Get-AzureSqlDatabaseCopy cmdlet.
It gets all geo-replication links between the specified Azure SQL Database and a resource group or AzureSQL Server.
Get-AzureRmSqlDatabaseReplicationLink -DatabaseName <databaseName> -PartnerResourceGroupName <partnerResourceGroupName> -ResourceGroupName <resourceGroupName> -ServerName <databaseServerName> | Select Role
Below is the result of the Azure PowerShell cmdlet above which get the replication role of the geo-replicated Azure SQL Databases.
Note:
The partnerResourceGroupName and resourceGroupName can be the same if the geo-replicated databases and server are in the same resource group as the primary.
you need to use the
Get-AzureRmSqlDatabaseReplicationLinkcmdlet. Refer to this article:https://learn.microsoft.com/en-us/azure/sql-database/scripts/sql-database-setup-geodr-and-failover-database-powershell