az sql failover-group

Manage SQL Failover Groups.

Commands

az sql failover-group create Creates a failover group.
az sql failover-group delete Deletes a failover group.
az sql failover-group list Lists the failover groups in a server.
az sql failover-group set-primary Set the primary of the failover group by failing over all databases from the current primary server.
az sql failover-group show Gets a failover group.
az sql failover-group update Updates the failover group.

az sql failover-group create

Creates a failover group.

az sql failover-group create --name
--partner-server
--resource-group
--server
[--add-db]
[--failover-policy {Automatic, Manual}]
[--grace-period]
[--partner-resource-group]
[--subscription]

Required Parameters

--name -n

The name of the Failover Group.

--partner-server

The name of the partner server of a Failover Group.

--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. You can configure the default using az configure --defaults sql-server=<name>.

Optional Parameters

--add-db

List of databases to add to Failover Group.

--failover-policy

The failover policy of the Failover Group.

accepted values: Automatic, Manual
default value: Automatic
--grace-period

Interval in hours before automatic failover is initiated if an outage occurs on the primary server. This indicates that Azure SQL Database will not initiate automatic failover before the grace period expires. Please note that failover operation with --allow-data-loss option might cause data loss due to the nature of asynchronous synchronization.

default value: 1
--partner-resource-group

The name of the resource group of the partner server.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql failover-group delete

Deletes a failover group.

az sql failover-group delete --name
[--ids]
[--resource-group]
[--server]
[--subscription]

Required Parameters

--name -n

The name of the Failover Group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--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. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql failover-group list

Lists the failover groups in a server.

az sql failover-group list [--ids]
[--resource-group]
[--server]
[--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--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. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql failover-group set-primary

Set the primary of the failover group by failing over all databases from the current primary server.

az sql failover-group set-primary --name
[--allow-data-loss]
[--ids]
[--resource-group]
[--server]
[--subscription]

Examples

Set the primary of the failover group by failing over all databases from the current primary server. (autogenerated)

az sql failover-group set-primary --name MyFailoverGroup --resource-group MyResourceGroup --server myserver

Required Parameters

--name -n

The name of the Failover Group.

Optional Parameters

--allow-data-loss

Complete the failover even if doing so may result in data loss. This will allow the failover to proceed even if a primary database is unavailable.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--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. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql failover-group show

Gets a failover group.

az sql failover-group show --name
[--ids]
[--resource-group]
[--server]
[--subscription]

Required Parameters

--name -n

The name of the Failover Group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--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. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql failover-group update

Updates the failover group.

az sql failover-group update --name
[--add]
[--add-db]
[--failover-policy {Automatic, Manual}]
[--force-string]
[--grace-period]
[--ids]
[--remove]
[--remove-db]
[--resource-group]
[--server]
[--set]
[--subscription]

Required Parameters

--name -n

The name of the Failover Group.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--add-db

List of databases to add to Failover Group.

--failover-policy

The failover policy of the Failover Group.

accepted values: Automatic, Manual
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--grace-period

Interval in hours before automatic failover is initiated if an outage occurs on the primary server. This indicates that Azure SQL Database will not initiate automatic failover before the grace period expires. Please note that failover operation with --allow-data-loss option might cause data loss due to the nature of asynchronous synchronization.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--remove-db

List of databases to remove from Failover Group.

--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. You can configure the default using az configure --defaults sql-server=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.