az sql db replica

Manage replication between databases.

Commands

az sql db replica create Create a database as a readable secondary replica of an existing database.
az sql db replica delete-link Permanently stop data replication between two database replicas.
az sql db replica list-links List the replicas of a database and their replication status.
az sql db replica set-primary Set the primary replica database by failing over from the current primary replica database.

az sql db replica create

Create a database as a readable secondary replica of an existing database.

az sql db replica create --name
--partner-server
--resource-group
--server
[--elastic-pool]
[--no-wait]
[--partner-resource-group]
[--service-objective]
[--tags]

Required Parameters

--name -n
Name of the Azure SQL Database.
--partner-server
Name of the server to create the new replica in.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
--server -s
Name of the Azure SQL server.

Optional Parameters

--elastic-pool
Name of elastic pool to create the new replica in.
--no-wait
Do not wait for the long running operation to finish.
--partner-resource-group
Name of the resource group to create the new replica in. If unspecified, defaults to the origin resource group.
--service-objective
Name of service objective for the new replica.
--tags
Resource tags.

Permanently stop data replication between two database replicas.

az sql db replica delete-link --name
--partner-server
--resource-group
--server
[--partner-resource-group]
[--yes]

Required Parameters

--name -n
Name of the Azure SQL Database.
--partner-server
Name of the server that the other replica is in.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
--server -s
Name of the Azure SQL server.

Optional Parameters

--partner-resource-group
Name of the resource group that the other replica is in. If unspecified, defaults to the first database's resource group.
--yes -y
Do not prompt for confirmation.

List the replicas of a database and their replication status.

az sql db replica list-links --name
--resource-group
--server

Required Parameters

--name -n
Name of the Azure SQL Database.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
--server -s
Name of the Azure SQL server.

az sql db replica set-primary

Set the primary replica database by failing over from the current primary replica database.

az sql db replica set-primary --name
--resource-group
--server
[--allow-data-loss]

Required Parameters

--name -n
Name of the database to fail over.
--resource-group -g
Name of the resource group containing the secondary replica that will become the new primary.
--server -s
Name of the server containing the secondary replica that will become the new primary.

Optional Parameters

--allow-data-loss
If specified, the failover operation will allow data loss.