Editar

Partilhar via


Update-AzSqlInstanceLink

Updates the properties of an instance link.

Syntax

Update-AzSqlInstanceLink
      [-ResourceGroupName] <String>
      [-InstanceName] <String>
      [-Name] <String>
      [-ReplicationMode] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzSqlInstanceLink
      [-Name] <String>
      [-ReplicationMode] <String>
      [-InstanceObject] <AzureSqlManagedInstanceModel>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzSqlInstanceLink
      [[-ReplicationMode] <String>]
      [-InputObject] <AzureSqlManagedInstanceLinkModel>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzSqlInstanceLink
      [-ReplicationMode] <String>
      [-ResourceId] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Update-AzSqlInstanceLink cmdlet modifies properties of an instance link.

Examples

Update-AzSqlInstanceLink -ResourceGroupName "ResourceGroup1" -InstanceName "ManagedInstance01" -Name "Link01" -ReplicationMode "Sync"

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                  : Sync
FailoverMode                     : Manual
SeedingMode                      : Automatic

This command sets the replication mode of an instance link to "Sync".

Update-AzSqlInstanceLink -ResourceGroupName "ResourceGroup1" -InstanceName "ManagedInstance01" -Name "Link01" -ReplicationMode "Async"

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 sets the replication mode of an instance link to "Aync".

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

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 sets the replication mode of an instance link to "Sync" by its resource identifier.

$managedInstanceLink = Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01" 
Update-AzSqlInstanceLink -InputObject $managedInstanceLink -ReplicationMode "Async"

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 sets the replication mode of an instance link to "Async" using the input object.

$managedInstanceLink = Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01" 
$managedInstanceLink.ReplicationMode = "Async"
Update-AzSqlInstanceLink -InputObject $managedInstanceLink

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 sets the instance link using input object.

$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01" 
Update-AzSqlInstanceLink -InstanceObject $instance -Name "Link01" -ReplicationMode "Async"

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 sets the replication mode of a instance link to "Async" using parent instance object.

Parameters

-Confirm

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

-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

-InputObject

Instance link input object.

Type:AzureSqlManagedInstanceLinkModel
Position:0
Default value:None
Required:True
Accept pipeline input:True
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

-Name

Managed Instance link name.

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

-ReplicationMode

Replication mode of a Managed Instance link. Parameter will be ignored during link creation.

Type:String
Position:3
Default value:None
Required:True
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

-WhatIf

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

Inputs

String

AzureSqlManagedInstanceModel

AzureSqlManagedInstanceLinkModel

Outputs

AzureSqlManagedInstanceLinkModel