Das Add-AzHDInsightClusterIdentity-Cmdlet fügt dem azure HDInsight-Konfigurationsobjekt, das vom Cmdlet New-AzHDInsightClusterConfig erstellt wurde, eine Clusteridentität hinzu.
Beispiele
Beispiel 1: Hinzufügen von Clusteridentitätsinformationen zum Clusterkonfigurationsobjekt
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Cluster Identity values
$tenantId = (Get-AzContext).Tenant.TenantId
$objectId = "<Azure AD Service Principal Object ID>"
$applicationId = "<Azure AD Service Principal Application ID>"
$certificateFilePath = "<Path to Azure AD Service Principal Certificate>"
$certificatePassword = "<Password for Azure AD Service Principal Certificate>"
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightClusterIdentity `
-AadTenantId $tenantId `
-ObjectId $objectId `
-ApplicationId $applicationId `
-CertificateFilePath $certificateFilePath `
-CertificatePassword $certificatePassword `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Linux `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageAccountContainer
Mit diesem Befehl werden clusteridentitätsinformationen zum Cluster namens "your-hadoop-001" hinzugefügt, sodass der Cluster auf Azure Data Lake Store zugreifen kann.
Parameter
-AadTenantId
Gibt die Microsoft Entra-Mandanten-ID an, die beim Zugriff auf den Azure Data Lake Store verwendet wird.
Gibt den Dateipfad zum Zertifikat an, das zum Authentifizieren als Dienstprinzipal verwendet wird.
Der Cluster verwendet dies beim Zugriff auf den Azure Data Lake Store.
Gibt das Kennwort für das Zertifikat an, das zum Authentifizieren als Dienstprinzipal verwendet wird.
Der Cluster verwendet dies beim Zugriff auf den Azure Data Lake Store.
Gibt die Microsoft Entra-Objekt-ID (eine GUID) des Microsoft Entra-Dienstprinzipals an, der den Cluster darstellt.
Der Cluster verwendet dies beim Zugriff auf den Azure Data Lake Store.
Dieses Cmdlet unterstützt die allgemeinen Parameter -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction und -WarningVariable. Weitere Informationen findest du unter about_CommonParameters.