Skip to content

Commit

Permalink
[HDInsight] Fix a bug (#26135)
Browse files Browse the repository at this point in the history
* Fix a bug

* Update changelog

* Update example

---------

Co-authored-by: v-yuchenli <[email protected]>
  • Loading branch information
yuc-Li and v-yuchenli authored Sep 20, 2024
1 parent ba0cb01 commit fff096b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/HDInsight/HDInsight/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->

## Upcoming Release
* Fixed a bug: Error occurs when setting the same assigned identity for storage and esp configurations.

## Version 6.2.0
* Added new feature: Enable adding public IP tags to clusters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ var storageAccount in
{
clusterIdentity.UserAssignedIdentities.Add(AssignedIdentity, new UserAssignedIdentity());
}
if (StorageAccountManagedIdentity != null)
if (StorageAccountManagedIdentity != null && !clusterIdentity.UserAssignedIdentities.ContainsKey(StorageAccountManagedIdentity))
{
clusterIdentity.UserAssignedIdentities.Add(StorageAccountManagedIdentity, new UserAssignedIdentity());
}
Expand Down
49 changes: 47 additions & 2 deletions src/HDInsight/HDInsight/help/New-AzHDInsightCluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ New-AzHDInsightCluster `
### Example 8: Create an Azure HDInsight cluster with Azure Data Lake Gen2 storage.
```powershell
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageManagedIdentity = "yourstorageusermanagedidentity"
$storageFileSystem = "filesystem01"
Expand Down Expand Up @@ -412,7 +411,7 @@ New-AzHDInsightCluster `
-SshCredential $clusterCreds
```

### Example 9: Create an Azure HDInsight cluster with Enterprise Security Package(ESP) and Enable HDInsight ID Broker.
### Example 9: Create an Azure HDInsight cluster with Enterprise Security Package(ESP), Enable HDInsight ID Broker and using WASB storage.
```powershell
# Primary storage account info
$storageAccountResourceGroupName = "Group"
Expand Down Expand Up @@ -623,6 +622,52 @@ New-AzHDInsightCluster `
-AmbariDatabase $config.AmbariDatabase -HiveMetastore $config.HiveMetastore -OozieMetastore $config.OozieMetastore -Zone $zones
```

### Example 13: Create an Azure HDInsight cluster with Enterprise Security Package(ESP) and using Azure Data Lake Gen2 storage.
```powershell
# Primary storage account info
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageManagedIdentity = "yourstorageusermanagedidentity"
$storageFileSystem = "filesystem01"
$storageAccountType = "AzureDataLakeStorageGen2"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-002"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# ESP configuration
$domainResourceId = "your Azure AD Domin Service resource id"
$domainUser = "yourdomainuser"
$domainPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
$domainCredential = New-Object System.Management.Automation.PSCredential($domainUser, $domainPassword)
$clusterUserGroupDns = "dominusergroup"
$ldapUrls = "ldaps://{your domain name}:636"
$clusterTier = "Premium"
$vnetId = "yourvnetid"
$subnetName = "yoursubnetname"
$assignedIdentity = "your user managed assigned identity resourcee id"
#Create security profile
$config= New-AzHDInsightClusterConfig|Add-AzHDInsightSecurityProfile -DomainResourceId $domainResourceId -DomainUserCredential $domainCredential -LdapsUrls $ldapUrls -ClusterUsersGroupDNs $clusterUserGroupDns
# Create the cluster
New-AzHDInsightCluster `
-ClusterTier $clusterTier `
-ClusterType Hadoop `
-ClusterSizeInNodes 3 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountManagedIdentity $storageManagedIdentity `
-StorageFileSystem $storageFileSystem `
-StorageAccountType $storageAccountType `
-SshCredential $clusterCreds `
-VirtualNetworkId $vnetId -SubnetName $subnetName `
-AssignedIdentity $assignedIdentity `
-SecurityProfile $config.SecurityProfile
```

## PARAMETERS

### -AadTenantId
Expand Down

0 comments on commit fff096b

Please sign in to comment.