Editar

Partilhar via


Set-AzSqlInstanceDtc

Sets properties for an Azure SQL Managed Instance DTC

Syntax

Set-AzSqlInstanceDtc
   [-ResourceGroupName] <String>
   [-InstanceName] <String>
   [[-DtcEnabled] <Boolean>]
   [[-ExternalDnsSuffixSearchList] <System.Collections.Generic.List`1[System.String]>]
   [-XaTransactionsEnabled <Boolean>]
   [-SnaLu6point2TransactionsEnabled <Boolean>]
   [-XaTransactionsDefaultTimeout <Int32>]
   [-XaTransactionsMaximumTimeout <Int32>]
   [-AllowInboundEnabled <Boolean>]
   [-AllowOutboundEnabled <Boolean>]
   [-Authentication <String>]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlInstanceDtc
   [-InstanceObject] <AzureSqlManagedInstanceModel>
   [[-DtcEnabled] <Boolean>]
   [[-ExternalDnsSuffixSearchList] <System.Collections.Generic.List`1[System.String]>]
   [-XaTransactionsEnabled <Boolean>]
   [-SnaLu6point2TransactionsEnabled <Boolean>]
   [-XaTransactionsDefaultTimeout <Int32>]
   [-XaTransactionsMaximumTimeout <Int32>]
   [-AllowInboundEnabled <Boolean>]
   [-AllowOutboundEnabled <Boolean>]
   [-Authentication <String>]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlInstanceDtc
   [-InputObject] <AzureSqlManagedInstanceDtcModel>
   [[-DtcEnabled] <Boolean>]
   [[-ExternalDnsSuffixSearchList] <System.Collections.Generic.List`1[System.String]>]
   [-XaTransactionsEnabled <Boolean>]
   [-SnaLu6point2TransactionsEnabled <Boolean>]
   [-XaTransactionsDefaultTimeout <Int32>]
   [-XaTransactionsMaximumTimeout <Int32>]
   [-AllowInboundEnabled <Boolean>]
   [-AllowOutboundEnabled <Boolean>]
   [-Authentication <String>]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlInstanceDtc
   [-ResourceId] <String>
   [[-DtcEnabled] <Boolean>]
   [[-ExternalDnsSuffixSearchList] <System.Collections.Generic.List`1[System.String]>]
   [-XaTransactionsEnabled <Boolean>]
   [-SnaLu6point2TransactionsEnabled <Boolean>]
   [-XaTransactionsDefaultTimeout <Int32>]
   [-XaTransactionsMaximumTimeout <Int32>]
   [-AllowInboundEnabled <Boolean>]
   [-AllowOutboundEnabled <Boolean>]
   [-Authentication <String>]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzSqlInstanceDtc cmdlet modifies properties of an Azure SQL Managed instance DTC.

Examples

Example 1 Enable DTC for a managed instance

Set-AzSqlInstanceDtc -ResourceGroupName ResourceGroup1 -InstanceName ManagedInstance1 -DtcEnabled $true

ResourceGroupName           : ResourceGroup1
ManagedInstanceName         : ManagedInstance1
Id                          : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Sql/managedInstances/ManagedInstance1/dtc/current
DtcEnabled                  : True
DtcHostNameDnsSuffix        : suffix1.net
DtcHostName                 : name1.suffix1.net
ExternalDnsSuffixSearchList : {suffix1.net}
SecuritySettings            : Microsoft.Azure.Management.Sql.Models.ManagedInstanceDtcSecuritySettings

This command enables managed instance DTC for the managed instance ManagedInstance1.

Example 2 Enable XA transactions for DTC

$dtc = Set-AzSqlInstanceDtc -ResourceGroupName ResourceGroup1 -InstanceName ManagedInstance1 -XaTransactionsEnabled $true
Write-Output $dtc.SecuritySettings

TransactionManagerCommunicationSettings : Microsoft.Azure.Management.Sql.Models.ManagedInstanceDtcTransactionManagerCommunicationSettings
XaTransactionsEnabled                   : True
SnaLu6point2TransactionsEnabled         : True
XaTransactionsDefaultTimeout            : 0
XaTransactionsMaximumTimeout            : 0

This command enables XA transactions for managed instance DTC

Example 3 Enable DTC for a previously fetched managed instance

$managedInstance = Get-AzSqlInstance -ResourceGroupName ResourceGroup1 -InstanceName ManagedInstance1
Set-AzSqlInstanceDtc -InstanceObject $managedInstance

ResourceGroupName           : ResourceGroup1
ManagedInstanceName         : ManagedInstance1
Id                          : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Sql/managedInstances/ManagedInstance1/dtc/current
DtcEnabled                  : True
DtcHostNameDnsSuffix        : suffix1.net
DtcHostName                 : name1.suffix1.net
ExternalDnsSuffixSearchList : {suffix1.net}
SecuritySettings            : Microsoft.Azure.Management.Sql.Models.ManagedInstanceDtcSecuritySettings

This command enables managed instance DTC by passing managed instance object.

Example 4 Enable XA transactions for a previously fetched DTC object

$dtc = Get-AzSqlInstanceDtc -ResourceGroupName ResourceGroup1 -InstanceName ManagedInstance1
$dtc = Set-AzSqlInstanceDtc -InputObject $dtc -DtcEnabled $true
Write-Output $dtc.SecuritySettings

TransactionManagerCommunicationSettings : Microsoft.Azure.Management.Sql.Models.ManagedInstanceDtcTransactionManagerCommunicationSettings
XaTransactionsEnabled                   : True
SnaLu6point2TransactionsEnabled         : True
XaTransactionsDefaultTimeout            : 0
XaTransactionsMaximumTimeout            : 0

This command enables XA transactions for DTC by passing DTC object.

Example 5 Enable DTC with a specific resource ID

Set-AzSqlInstanceDtc -ResourceId /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Sql/managedInstances/ManagedInstance1/dtc/current -DtcEnabled $true

ResourceGroupName           : ResourceGroup1
ManagedInstanceName         : ManagedInstance1
Id                          : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Sql/managedInstances/ManagedInstance1/dtc/current
DtcEnabled                  : True
DtcHostNameDnsSuffix        : suffix1.net
DtcHostName                 : name1.suffix1.net
ExternalDnsSuffixSearchList : {suffix1.net}
SecuritySettings            : Microsoft.Azure.Management.Sql.Models.ManagedInstanceDtcSecuritySettings

This command enables managed instance DTC by passing the resource ID of the DTC.

Parameters

-AllowInboundEnabled

Enable inbound traffic.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AllowOutboundEnabled

Enable outbound traffic.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Run cmdlet in the background.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Authentication

Authentication type.

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

-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

-DtcEnabled

DTC enabled status.

Type:Nullable<T>[Boolean]
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExternalDnsSuffixSearchList

External DNS suffix search list.

Type:List<T>[String]
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Skip confirmation message for performing the action.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Input object of the managed instance DTC.

Type:AzureSqlManagedInstanceDtcModel
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

Input object of the managed instance.

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

Resource ID of the managed instance DTC.

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

-SnaLu6point2TransactionsEnabled

SNA LU 6.2 transactions enabled status.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-XaTransactionsDefaultTimeout

XA transactions default timeout.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-XaTransactionsEnabled

XA transactions enabled status.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-XaTransactionsMaximumTimeout

XA transactions maximum timeout.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureSqlManagedInstanceModel

AzureSqlManagedInstanceDtcModel

String

Outputs

AzureSqlManagedInstanceDtcModel