Share via


az sql failover-group

Manage SQL Failover Groups.

Commands

Name Description Type Status
az sql failover-group create

Creates a failover group.

Core GA
az sql failover-group delete

Deletes a failover group.

Core GA
az sql failover-group list

Lists the failover groups in a server.

Core GA
az sql failover-group set-primary

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

Core GA
az sql failover-group show

Gets a failover group.

Core GA
az sql failover-group update

Updates the failover group.

Core GA

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]
                             [--secondary-type {Geo, Standby}]

Examples

Creates a failover group. (autogenerated)

az sql failover-group create --name MyFailoverGroup --partner-server newDb --resource-group MyResourceGroup --server myserver --subscription MySubscription

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

--secondary-type

Databases secondary type on partner server.

Accepted values: Geo, Standby
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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]
                                  [--tpbff]

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.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

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

--tpbff --try-planned-before-forced-failover

Performs a planned failover as the first step, and if it fails for any reason, then initiates a forced failover with potential data loss. This will allow the failover to proceed even if a primary database is unavailable.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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]
                             [--secondary-type {Geo, Standby}]
                             [--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>.

Default value: []
--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.

Default value: False
--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). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--remove

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

Default value: []
--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>.

--secondary-type

Databases secondary type on partner server.

Accepted values: Geo, Standby
--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=<value>.

Default value: []
--subscription

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.