Set-AzSqlDatabaseInstanceFailoverGroup

Modifies the configuration of an Instance Failover Group.

Syntax

Set-AzSqlDatabaseInstanceFailoverGroup
   [-ResourceGroupName] <String>
   [-Location] <String>
   [-Name] <String>
   [-FailoverPolicy <FailoverPolicy>]
   [-GracePeriodWithDataLossHours <Int32>]
   [-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlDatabaseInstanceFailoverGroup
   [-Location] <String>
   [-ResourceId] <String>
   [-FailoverPolicy <FailoverPolicy>]
   [-GracePeriodWithDataLossHours <Int32>]
   [-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlDatabaseInstanceFailoverGroup
   -InputObject <AzureSqlInstanceFailoverGroupModel>
   [-FailoverPolicy <FailoverPolicy>]
   [-GracePeriodWithDataLossHours <Int32>]
   [-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This command modifies the configuration of an Instance Failover Group.

The Instance Failover Group's primary region should be used to execute the command.

During preview of the Instance Failover Groups feature, only values greater than or equal to 1 hour are supported for the '-GracePeriodWithDataLossHours' parameter.

Examples

Example 1

PS C:\> $failoverGroup = Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location location -Name fg | Set-AzSqlDatabaseFailoverGroup -FailoverPolicy Manual
Output:
ResourceGroupName                     : rg
Location                              : East US
Name                                  : fg
PartnerResourceGroupName              : rg
PartnerRegion                         : West US
PrimaryManagedInstanceName            : managedInstance1
PartnerManagedInstanceName            : managedInstance2
ReplicationRole                       : Primary
ReplicationState                      : CATCH_UP
ReadWriteFailoverPolicy               : Manual
FailoverWithDataLossGracePeriodHours  : 
ReadOnlyFailoverPolicy                : Disabled
Id                                    : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg/providers/Microsoft.Sql/locations/eastus/instanceFailoverGroups/fg

Sets a Instance 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. This feature is not yet supported.

Type:AllowReadOnlyFailoverToPrimary
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FailoverPolicy

The failover policy of the Instance Failover Group.

Type:FailoverPolicy
Accepted values:Automatic, Manual
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-GracePeriodWithDataLossHours

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:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

The Instance Failover Group object to set

Type:AzureSqlInstanceFailoverGroupModel
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Location

The name of the Local Region from which to retrieve the Instance Failover Group.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

The name of the Instance Failover Group.

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId

The Resource ID of the Instance Failover Group to set.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Sql.InstanceFailoverGroup.Model.AzureSqlInstanceFailoverGroupModel

System.String

Outputs

Microsoft.Azure.Commands.Sql.InstanceFailoverGroup.Model.AzureSqlInstanceFailoverGroupModel