Editar

Compartilhar via


Update-AzHDInsightCluster

Update tags or managed identities for a HDInsight cluster.

Syntax

Update-AzHDInsightCluster
      [-ClusterName] <String>
      [-IdentityType <String>]
      [-IdentityId <String[]>]
      [-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
      [-ResourceGroupName <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

This Update-AzHDInsightCluster cmdlet update the tags or managed identity of HDInsight cluster.

Examples

Example 1: Update tags for the cluster.

$clusterName = "your-hadoop-001"
$tags = New-Object 'System.Collections.Generic.Dictionary[System.String,System.String]'
$tags.Add('Tag1', 'Value1')
$tags.Add('Tag2', 'Value2')

Update-AzHDInsightCluster -ClusterName $clusterName -Tag $tags

Example 2: Update manage identity with single UserAssigned msi.

$clusterName = "your-hadoop-001"
$identityType = "UserAssigned"
$identityId = "/subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/rg/providers/Microsoft ManagedIdentity/userAssignedIdentities/hdi-msi"

Update-AzHDInsightCluster -ClusterName $clusterName -IdentityType $identityType -IdentityId $identityId

Example 3: Update manage identity with multiple UserAssigned msi.

$clusterName = "your-hadoop-001"
$identityType = "UserAssigned"
$identityIds = @(
 "/subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi",
 "/subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi1"
)

Update-AzHDInsightCluster -ClusterName $clusterName -IdentityType $identityType -IdentityId $identityIds

Example 4: Update SystemAssigned manage identity.

$clusterName = "your-hadoop-001"
$identityType = "SystemAssigned"
$identityId = "/subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi"

Update-AzHDInsightCluster -ClusterName $clusterName -IdentityType $identityType

Example 5: Update manage identity with SystemAssigned,UserAssigned msi.

$clusterName = "your-hadoop-001"
$identityId = "/subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi"
$identityType = "SystemAssigned,UserAssigned"

Update-AzHDInsightCluster -ClusterName $clusterName -IdentityType $identityType -IdentityId $identityId

Parameters

-ClusterName

Gets or sets the name of the cluster.

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

-IdentityId

Gets or sets the list of user identities associated with the cluster.

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

-IdentityType

Gets or sets the type of identity used for the cluster. Possible values include: SystemAssigned, UserAssigned.

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

-ResourceGroupName

Gets or sets the name of the resource group.

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

-Tag

The resource tags.

Type:Dictionary<TKey,TValue>[System.String,System.String]
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

Inputs

None

Outputs

AzureHDInsightCluster