Switch-AzSqlDatabaseInstanceFailoverGroup
Executes a failover of an Instance Failover Group.
Switch-AzSqlDatabaseInstanceFailoverGroup
[-ResourceGroupName] <String>
[-Location] <String>
[-Name] <String>
[-AllowDataLoss]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Switch-AzSqlDatabaseInstanceFailoverGroup
[-Location] <String>
[-ResourceId] <String>
[-AllowDataLoss]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Switch-AzSqlDatabaseInstanceFailoverGroup
[-InputObject] <AzureSqlInstanceFailoverGroupModel>
[-AllowDataLoss]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This command swaps the roles of the managed instances in a Instance Failover Group by failing over to the specified secondary region, making it the new primary region. All new TDS sessions connecting to the primary endpoint are automatically re-routed to the new primary region.
Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location location -Name fg | Switch-AzSqlDatabaseInstanceFailoverGroup -AllowDataLoss
ResourceGroupName : rg
Location : East US
Name : fg
PartnerResourceGroupName : rg
PartnerRegion : West US
PrimaryManagedInstanceName : managedInstance1
PartnerManagedInstanceName : managedInstance2
ReplicationRole : Primary
ReplicationState : CATCH_UP
ReadWriteFailoverPolicy : Automatic
FailoverWithDataLossGracePeriodHours : 1
ReadOnlyFailoverPolicy : Disabled
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg/providers/Microsoft.Sql/locations/eastus/instanceFailoverGroups/fg
Issue a failover operation allowing data loss by piping in the Instance Failover Group.
Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location location -Name fg | Switch-AzSqlDatabaseInstanceFailoverGroup
ResourceGroupName : rg
Location : East US
Name : fg
PartnerResourceGroupName : rg
PartnerRegion : West US
PrimaryManagedInstanceName : managedInstance1
PartnerManagedInstanceName : managedInstance2
ReplicationRole : Primary
ReplicationState : CATCH_UP
ReadWriteFailoverPolicy : Automatic
FailoverWithDataLossGracePeriodHours : 1
ReadOnlyFailoverPolicy : Disabled
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg/providers/Microsoft.Sql/locations/eastus/instanceFailoverGroups/fg
Issue a best effort failover operation that will either succeed without losing data or fail and roll back.
Complete the failover even if doing so may result in data loss. This will allow the failover to proceed even if a primary database is unavailable.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
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 Instance Failover Group object to switch
Type: | AzureSqlInstanceFailoverGroupModel |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The name of the Local Region of the secondary instance in the Instance Failover Group.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the Instance Failover Group.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the resource group of the secondary instance in the Instance Failover Group.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The Resource ID of the Instance Failover Group to switch.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
AzureSqlInstanceFailoverGroupModel
System.String
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback: