Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-AzSqlDatabaseFailoverGroup
- Module:
- Az.Sql Module
Modifies the configuration of an Azure SQL Database Failover Group.
Syntax
Default (Default)
Set-AzSqlDatabaseFailoverGroup
[-ServerName] <String>
[-FailoverGroupName] <String>
[-FailoverPolicy <FailoverPolicy>]
[-GracePeriodWithDataLossHours <Int32>]
[-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
[-PartnerServerList <System.Collections.Generic.List`1[System.String]>]
[-ReadOnlyEndpointTargetServer <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
This command modifies the configuration of an Azure SQL Database Failover Group. The Failover Group's primary server should be used to execute the command. To control the set of databases in the group, use 'Add-AzSqlDatabaseToFailoverGroup' and 'Remove-AzSqlDatabaseFromFailoverGroup' instead. During preview of the Failover Groups feature, only values greater than or equal to 1 hour are supported for the '-GracePeriodWithDataLossHours' parameter.
Examples
Example 1
$failoverGroup = Set-AzSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg -FailoverPolicy Automatic -GracePeriodWithDataLossHours 1
Sets a Failover Group's failover policy to 'Automatic.'
Example 2
$failoverGroup = Get-AzSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg | Set-AzSqlDatabaseFailoverGroup -FailoverPolicy Manual
Sets a Failover Group's failover policy to 'Manual' by piping in the Failover Group.
Parameters
-AllowReadOnlyFailoverToPrimary
Whether outages on the secondary server should trigger automatic failover of the read-only endpoint.
Parameter properties
| Type: | AllowReadOnlyFailoverToPrimary |
| Default value: | None |
| Accepted values: | Enabled, Disabled |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-FailoverGroupName
The name of the Azure SQL Database Failover Group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-FailoverPolicy
The failover policy of the Azure SQL Database Failover Group.
Parameter properties
| Type: | FailoverPolicy |
| Default value: | Manual |
| Accepted values: | Automatic, Manual |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-GracePeriodWithDataLossHours
Interval 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 AllowDataLoss option might cause data loss due to the nature of asynchronous synchronization.
Parameter properties
| Type: | Int32 |
| Default value: | 1 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartnerServerList
The list of partner servers in the failover group (empty list for 0 servers).
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ReadOnlyEndpointTargetServer
The name of the target server for the read only endpoint.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
The name of the resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ServerName
The name of the primary Azure SQL Database Server of the Failover Group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Outputs
AzureSqlFailoverGroupModel
Related Links
Azure PowerShell
Feedback
Was this page helpful?
