Set-AzSqlDatabaseInstanceFailoverGroup
Modifies the configuration of an Instance Failover Group.
Syntax
SetInstanceFailoverGroupDefaultSet (Default)
Set-AzSqlDatabaseInstanceFailoverGroup
[-ResourceGroupName] <String>
[-Location] <String>
[-Name] <String>
[-FailoverPolicy <String>]
[-GracePeriodWithDataLossHours <Int32>]
[-AllowReadOnlyFailoverToPrimary <String>]
[-SecondaryType <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetInstanceFailoverGroupByResourceIdSet
Set-AzSqlDatabaseInstanceFailoverGroup
[-Location] <String>
[-ResourceId] <String>
[-FailoverPolicy <String>]
[-GracePeriodWithDataLossHours <Int32>]
[-AllowReadOnlyFailoverToPrimary <String>]
[-SecondaryType <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetInstanceFailoverGroupByAzureSqlInstanceFailoverGroupModelSet
Set-AzSqlDatabaseInstanceFailoverGroup
[-InputObject] <AzureSqlInstanceFailoverGroupModel>
[-FailoverPolicy <String>]
[-GracePeriodWithDataLossHours <Int32>]
[-AllowReadOnlyFailoverToPrimary <String>]
[-SecondaryType <String>]
[-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
$failoverGroup = Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location ___location -Name fg | Set-AzSqlDatabaseInstanceFailoverGroup -FailoverPolicy Manual
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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-FailoverPolicy
The failover policy of the Instance Failover Group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-GracePeriodWithDataLossHours
Interval before automatic failover is initiated if an outage occurs on the primary server and failover cannot be completed without data loss.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The Instance Failover Group object to set
SetInstanceFailoverGroupByAzureSqlInstanceFailoverGroupModelSet
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Location
The name of the Local Region from which to retrieve the Instance Failover Group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetInstanceFailoverGroupDefaultSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
SetInstanceFailoverGroupByResourceIdSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The name of the Instance Failover Group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetInstanceFailoverGroupDefaultSet
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetInstanceFailoverGroupDefaultSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceId
The Resource ID of the Instance Failover Group to set.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetInstanceFailoverGroupByResourceIdSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-SecondaryType
Intended usage of the secondary instance. Standby indicates that the secondary instance will be used as a passive replica for disaster recovery only.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
Outputs