Cmdleten Add-AzHDInsightClusterIdentity lägger till en klusteridentitet i Azure HDInsight konfigurationsobjekt som skapats av cmdleten New-AzHDInsightClusterConfig.
Exempel
Exempel 1: Lägg till information om klusteridentitet i klusterkonfigurationsobjektet
# 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
Det här kommandot lägger till klusteridentitetsinformation i klustret med namnet your-hadoop-001, vilket gör att klustret kan komma åt Azure Data Lake Store.
Parametrar
-AadTenantId
Anger det Microsoft Entra klientorganisations-ID som ska användas vid åtkomst till Azure Data Lake Store.
Anger filsökvägen till certifikatet som ska användas för att autentisera som tjänstens huvudnamn.
Klustret använder detta vid åtkomst till Azure Data Lake Store.
Anger lösenordet för certifikatet som ska användas för att autentisera som tjänstens huvudnamn.
Klustret använder detta vid åtkomst till Azure Data Lake Store.
Anger Microsoft Entra objekt-ID (ett GUID) för Microsoft Entra tjänstens huvudnamn som representerar klustret.
Klustret använder detta vid åtkomst till Azure Data Lake Store.
Den här cmdleten stöder vanliga parametrar: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction och -WarningVariable. Mer information finns i about_CommonParameters.