Set-AzureRmSqlDatabaseFailoverGroup
Syntax
Set-AzureRmSqlDatabaseFailoverGroup
[-ResourceGroupName] <String>
[-ServerName] <String>
[-FailoverGroupName] <String>
[-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
[-FailoverPolicy <FailoverPolicy>]
[-GracePeriodWithDataLossHours <Int32>]
[<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-AzureRmSqlDatabaseToFailoverGroup' and 'Remove-AzureRmSqlDatabaseFromFailoverGroup' 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
PS C:\> $failoverGroup = Set-AzureRmSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg -FailoverPolicy Automatic -GracePeriodWithDataLossHours 1
Sets a Failover Group's failover policy to 'Automatic.'
Example 2
PS C:\> $failoverGroup = Get-AzureRmSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg | Set-AzureRmSqlDatabaseFailoverGroup -FailoverPolicy Manual
Sets a Failover Group's failover policy to 'Manual' by piping in the Failover Group.
Required Parameters
The name of the Azure SQL Database Failover Group.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The name of the primary Azure SQL Database Server of the Failover Group.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Optional Parameters
Whether outages on the secondary server should trigger automatic failover of the read-only endpoint. This feature is not yet supported.
| Type: | AllowReadOnlyFailoverToPrimary |
| Parameter Sets: | Enabled, Disabled |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The failover policy of the Azure SQL Database Failover Group.
| Type: | FailoverPolicy |
| Parameter Sets: | Automatic, Manual |
| Position: | Named |
| Default value: | Automatic |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Interval before automatic failover is initiated if an outage occurs on the primary server and failover cannot be completed without data loss.
| Type: | Int32 |
| Position: | Named |
| Default value: | 1 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
System.String
Outputs
System.Object