Editar

Compartir a través de


Get-AzSqlInstanceLink

Returns information about link feature for Azure SQL Managed Instance.

Syntax

Get-AzSqlInstanceLink
   [-ResourceGroupName] <String>
   [-InstanceName] <String>
   [[-Name] <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceLink
   [[-Name] <String>]
   [-InstanceObject] <AzureSqlManagedInstanceModel>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceLink
   [[-Name] <String>]
   [-InstanceResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceLink
   [-ResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzSqlInstanceLink cmdlet returns information about one or more instance of Managed Instance links. Specify the name of a link to see information for that link only.

Examples

Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about the instance link named "Link01" on instance "Instance01" and resource group "ResourceGroup01".

Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link02
Name                             : Link02
DistributedAvailabilityGroupName : Link02
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database02}
InstanceAvailabilityGroupName    : AG_Database02_MI
PartnerAvailabilityGroupName     : AG_Database02
PartnerEndpoint                  : TCP://SERVER02:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about all active instance links on instance "ManagedInstance01" and resource group "ResourceGroup01".

$instance = Get-AzSqlInstance -Name "ManagedInstance01" -ResourceGroupName "ResourceGroup01"
Get-AzSqlInstanceLink -InstanceObject $instance

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link02
Name                             : Link02
DistributedAvailabilityGroupName : Link02
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database02}
InstanceAvailabilityGroupName    : AG_Database02_MI
PartnerAvailabilityGroupName     : AG_Database02
PartnerEndpoint                  : TCP://SERVER02:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information on all active instance links on the instance "ManagedInstance01".

Get-AzSqlInstanceLink -InstanceResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link02
Name                             : Link02
DistributedAvailabilityGroupName : Link02
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database02}
InstanceAvailabilityGroupName    : AG_Database02_MI
PartnerAvailabilityGroupName     : AG_Database02
PartnerEndpoint                  : TCP://SERVER02:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about all instance links for the instance "ManagedInstance01".

Get-AzSqlInstanceLink -ResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about the instance link named "Link01".

Get-AzSqlInstance -Name "ManagedInstance01" -ResourceGroupName "ResourceGroup01" | Get-AzSqlInstanceLink

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link02
Name                             : Link02
DistributedAvailabilityGroupName : Link02
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database02}
InstanceAvailabilityGroupName    : AG_Database02_MI
PartnerAvailabilityGroupName     : AG_Database02
PartnerEndpoint                  : TCP://SERVER02:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about all instance links within the instance "ManagedInstance01".

Get-AzSqlInstance -Name "ManagedInstance01" -ResourceGroupName "ResourceGroup01" | Get-AzSqlInstanceLink -Name "Link01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about the instance link named "Link01: within the instance "Instance01".

Get-AzSqlInstanceLink "ResourceGroup01" "ManagedInstance01" "Link01"

ResourceGroupName                : ResourceGroup01
InstanceName                     : ManagedInstance01
Type                             : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id                               : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name                             : Link01
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId   : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases                        : {Database01}
InstanceAvailabilityGroupName    : AG_Database01_MI
PartnerAvailabilityGroupName     : AG_Database01
PartnerEndpoint                  : TCP://SERVER01:5022
InstanceLinkRole                 : Secondary
PartnerLinkRole                  : Primary
ReplicationMode                  : Async
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command gets information about the instance link named "Link01" on instance "Instance01" and resource group "ResourceGroup01".

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

-InstanceName

Name of the managed instance.

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

-InstanceObject

Instance input object.

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

-InstanceResourceId

Managed instance resource ID.

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

-Name

Managed Instance link name.

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

-ResourceGroupName

Name of the resource group.

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

-ResourceId

The instance link resource ID.

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

Inputs

AzureSqlManagedInstanceModel

String

Outputs

AzureSqlManagedInstanceLinkModel