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]
                             [--partner-server-ids]
                             [--ro-endpoint-target]
                             [--ro-failover-policy {Disabled, Enabled}]
                             [--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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--add-db

List of databases to add to Failover Group.

--failover-policy

The failover policy of the Failover Group.

Property Value
Default value: Manual
Accepted values: Automatic, 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.

Property Value
Default value: 1
--partner-resource-group

The name of the resource group of the partner server.

--partner-server-ids

The list of partner server resource id's of the Failover Group.

--ro-endpoint-target

The resource id of the read only endpoint target server.

--ro-failover-policy

The policy of the read only endpoint of the Failover Group.

Property Value
Default value: Disabled
Accepted values: Disabled, Enabled
--secondary-type

Databases secondary type on partner server.

Property Value
Accepted values: Geo, Standby
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--server -s

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az sql failover-group list

Lists the failover groups in a server.

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--server -s

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

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 --try-planned-before-forced-failover]

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

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

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--server -s

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--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.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--server -s

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

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]
                             [--partner-server-ids]
                             [--remove]
                             [--remove-db]
                             [--resource-group]
                             [--ro-endpoint-target]
                             [--ro-failover-policy {Disabled, Enabled}]
                             [--secondary-type {Geo, Standby}]
                             [--server]
                             [--set]
                             [--subscription]

Required Parameters

--name -n

The name of the Failover Group.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--add-db

List of databases to add to Failover Group.

--failover-policy

The failover policy of the Failover Group.

Property Value
Accepted values: Automatic, Manual
--force-string

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

Property Value
Parameter group: Generic Update Arguments
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.

Property Value
Parameter group: Resource Id Arguments
--partner-server-ids

The list of partner server resource id's of the Failover Group.

--remove

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

Property Value
Parameter group: Generic Update Arguments
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>.

Property Value
Parameter group: Resource Id Arguments
--ro-endpoint-target

The resource id of the read only endpoint target server.

--ro-failover-policy

The policy of the read only endpoint of the Failover Group.

Property Value
Accepted values: Disabled, Enabled
--secondary-type

Databases secondary type on partner server.

Property Value
Accepted values: Geo, Standby
--server -s

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

Property Value
Parameter group: Resource Id Arguments
--set

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False