Add-AzHDInsightClusterIdentity
Adds a cluster identity to a cluster configuration object.
Syntax
Add-AzHDInsightClusterIdentity
[-Config] <AzureHDInsightConfig>
[-ObjectId] <Guid>
[-CertificateFilePath] <String>
[-CertificatePassword] <String>
[[-AadTenantId] <Guid>]
[[-ApplicationId] <Guid>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzHDInsightClusterIdentity
[-Config] <AzureHDInsightConfig>
[-ObjectId] <Guid>
[-CertificateFileContents] <Byte[]>
[-CertificatePassword] <String>
[[-AadTenantId] <Guid>]
[[-ApplicationId] <Guid>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Add-AzHDInsightClusterIdentity cmdlet adds a cluster identity to the Azure HDInsight configuration object created by the New-AzHDInsightClusterConfig cmdlet.
Examples
Example 1: Add Cluster Identity info to the cluster configuration object
PS C:\># Primary storage account info
PS C:\> $storageAccountResourceGroupName = "Group"
PS C:\> $storageAccountResourceId = "yourstorageaccountresourceid"
PS C:\> $storageAccountName = "yourstorageacct001"
PS C:\> $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
PS C:\> $storageContainer = "container001"
# Cluster configuration info
PS C:\> $location = "East US 2"
PS C:\> $clusterResourceGroupName = "Group"
PS C:\> $clusterName = "your-hadoop-001"
PS C:\> $clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Cluster Identity values
PS C:\> $tenantId = (Get-AzContext).Tenant.TenantId
PS C:\> $objectId = ""
PS C:\> $applicationId = ""
PS C:\> $certificateFilePath = ""
PS C:\> $certificatePassword = ""
# Create the cluster
PS C:\> New-AzHDInsightClusterConfig `
| Add-AzHDInsightClusterIdentity `
-AadTenantId $tenantId `
-ObjectId $objectId `
-Application $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
This command adds Cluster Identity info to the cluster named your-hadoop-001, allowing the cluster to access Azure Data Lake Store.
Parameters
Specifies the Azure AD Tenant ID that will be used when accessing Azure Data Lake Store.
Type: | Guid |
Position: | 4 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The Service Principal Application Id for accessing Azure Data Lake.
Type: | Guid |
Position: | 5 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies file contents of the certificate that will be used when accessing Azure Data Lake Store.
Type: | Byte[] |
Position: | 2 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the file path to the certificate that will be used to authenticate as the Service Principal. The cluster will use this when accessing Azure Data Lake Store.
Type: | String |
Position: | 2 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the password for the certificate that will be used to authenticate as the Service Principal. The cluster will use this when accessing Azure Data Lake Store.
Type: | String |
Position: | 3 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the HDInsight cluster configuration object that this cmdlet modifies. This object is created by the New-AzHDInsightClusterConfig cmdlet.
Type: | AzureHDInsightConfig |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
Type: | Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the Azure AD object ID (a GUID) of the Azure AD Service Principal that represents the cluster. The cluster will use this when accessing Azure Data Lake Store.
Type: | Guid |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |