az sql db replica

Manage replication between databases.

Commands

az sql db replica create Creates a database as a readable secondary replica of an existing database.
az sql db replica delete-link Permanently stops data replication between two database replicas.
az sql db replica list-links Lists the replicas of a database and corresponding replication status.
az sql db replica set-primary Sets which replica database is primary by failing over from the current primary replica database.

az sql db replica create

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

az sql db replica create --name
--partner-server
--resource-group
--server
[--elastic-pool]
[--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=.

--server -s

Name of the Azure SQL server.

Optional Parameters

--elastic-pool

Name of elastic pool to create the new replica in.

--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 stops 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=.

--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.

Lists the replicas of a database and corresponding 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=.

--server -s

Name of the Azure SQL server.

az sql db replica set-primary

Sets which replica database is primary 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.