Set-AzSqlDatabaseFailoverGroup
Modifies the configuration of an Azure SQL Database Failover Group.
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>]
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.
$failoverGroup = Set-AzSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg -FailoverPolicy Automatic -GracePeriodWithDataLossHours 1
Sets a Failover Group's failover policy to 'Automatic.'
$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.
Whether outages on the secondary server should trigger automatic failover of the read-only endpoint.
Type: | AllowReadOnlyFailoverToPrimary |
Accepted values: | Enabled, Disabled |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the Azure SQL Database Failover Group.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The failover policy of the Azure SQL Database Failover Group.
Type: | FailoverPolicy |
Accepted values: | Automatic, Manual |
Position: | Named |
Default value: | Manual |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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.
Type: | Int32 |
Position: | Named |
Default value: | 1 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The list of partner servers in the failover group (empty list for 0 servers).
The name of the target server for the read only endpoint.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the resource group.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The name of the primary Azure SQL Database Server of the Failover Group.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback: