Get-AzSqlDatabaseInstanceFailoverGroup

Gets or lists Instance Failover Groups.

Syntax

Get-AzSqlDatabaseInstanceFailoverGroup
   [[-Name] <String>]
   [-ResourceGroupName] <String>
   [-Location] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Gets a specific Instance Failover Group or lists the Instance Failover Groups in a region under the user's subscription.

Either region in the Instance Failover Group may be used to execute the command. The returned values will reflect the state of the Managed Instances in that region with respect to the Instance Failover Group.

Examples

Example 1

$failoverGroups = Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location location

{
	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
}

Lists all Failover Groups in the region

Example 2

$failoverGroup = Get-AzSqlDatabaseInstanceFailoverGroup -ResourceGroupName rg -Location location -Name fg

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

Get a specific Instance Failover Group.

Parameters

-DefaultProfile

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

-Location

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

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the Instance Failover Group to retrieve.

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

-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

AzureSqlInstanceFailoverGroupModel