< Back

Set-AzureRmSqlDatabaseFailoverGroup

Tue Jan 29, 2019 10:10 pm

NAME Set-AzureRmSqlDatabaseFailoverGroup



SYNOPSIS

Modifies the configuration of an Azure SQL Database Failover Group.





SYNTAX

Set-AzureRmSqlDatabaseFailoverGroup [-ResourceGroupName] <String> [-ServerName] <String> [-FailoverGroupName] <String>

[-AllowReadOnlyFailoverToPrimary {Enabled | Disabled}] [-DefaultProfile <IAzureContextContainer>] [-FailoverPolicy {Automatic | Manual}]

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





PARAMETERS

-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>

Whether outages on the secondary server should trigger automatic failover of the read-only endpoint. This feature is not yet supported.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FailoverGroupName <String>

The name of the Azure SQL Database Failover Group.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FailoverPolicy <FailoverPolicy>

The failover policy of the Azure SQL Database Failover Group.



Required? false

Position? named

Default value Automatic

Accept pipeline input? False

Accept wildcard characters? false



-GracePeriodWithDataLossHours <Int32>

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.



Required? false

Position? named

Default value 1

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the resource group.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

The name of the primary Azure SQL Database Server of the Failover Group.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String







OUTPUTS

System.Object







NOTES









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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... lovergroup

New-AzureRmSqlDatabaseFailoverGroup

Get-AzureRmSqlDatabaseFailoverGroup

Add-AzureRmSqlDatabaseToFailoverGroup

Remove-AzureRmSqlDatabaseFromFailoverGroup

Switch-AzureRmSqlDatabaseFailoverGroup

Remove-AzureRmSqlDatabaseFailoverGroup

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/