共用方式為


Update-AzHDInsightCluster

更新 HDInsight 叢集的標籤或受控識別。

語法

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

Update-AzHDInsightCluster Cmdlet 更新 HDInsight 叢集的標籤或受控識別。

範例

範例 1:更新叢集的標記。

$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

範例 2:使用單一 UserAssigned msi 更新管理身分識別。

$clusterName = "your-hadoop-001"
$identityType = "UserAssigned"
$identityId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft ManagedIdentity/userAssignedIdentities/hdi-msi"

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

範例 3:使用多個 UserAssigned msi 更新管理身分識別。

$clusterName = "your-hadoop-001"
$identityType = "UserAssigned"
$identityIds = @(
 "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi",
 "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi1"
)

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

範例 4:更新 SystemAssigned 管理身分識別。

$clusterName = "your-hadoop-001"
$identityType = "SystemAssigned"
$identityId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi"

Update-AzHDInsightCluster -ClusterName $clusterName -IdentityType $identityType

範例 5:使用 SystemAssigned、UserAssigned msi 更新管理身分識別。

$clusterName = "your-hadoop-001"
$identityId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi"
$identityType = "SystemAssigned,UserAssigned"

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

參數

-ClusterName

取得或設定叢集的名稱。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IdentityId

取得或設定與叢集相關聯的使用者身分識別清單。

類型:String[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IdentityType

取得或設定用於叢集的身分識別類型。 可能的值包括:SystemAssigned、UserAssigned。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

取得或設定資源群組的名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Tag

資源標記。

類型:Dictionary<TKey,TValue>[System.String,System.String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

AzureHDInsightCluster