question

KareemAbdul-1982 avatar image
0 Votes"
KareemAbdul-1982 asked ·

Unable to create HDInsight cluster using azure powershell

Unable to Create a HDInsight cluster using the below link
https://docs.microsoft.com/en-in/azure/hdinsight/hdinsight-administer-use-powershell

New-AzHDInsightCluster:
Line |
10 | -DefaultStorageAccountName "$defaultStorageAccountName.blob.core. …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
| A parameter cannot be found that matches parameter name 'DefaultStorageAccountName'.

Facing the issue above

Attached66695-error.png screenshot , Please help


azure-hdinsight
error.png (147.0 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered ·

Hello @KareemAbdul-1982,

Welcome to the Microsoft Q&A platform.

Thanks for bringing this to our attention. Currently, I’m working the docs team to update the document accordingly.

While using New-AzHDInsightCluster you will receive this error message because there is no parameter called DefaultStorageAccountName.

As per the Az.HDInsight powershell commands release notes:

 * For New-AzHDInsightCluster cmdlet:
     - Replaced parameter 'DefaultStorageAccountName' with 'StorageAccountResourceId'
     - Replaced parameter 'DefaultStorageAccountKey' with 'StorageAccountKey'
     - Replaced parameter 'DefaultStorageAccountType' with 'StorageAccountType'
     - Removed parameter 'PublicNetworkAccessType'
     - Removed parameter 'OutboundPublicNetworkAccessType'
     - Added new parameters: 'StorageFileSystem' and 'StorageAccountManagedIdentity' to support ADLSGen2
     - Added new parameter 'EnableIDBroker' to Support HDInsight ID Broker
     - Added new parameters: 'KafkaClientGroupId', 'KafkaClientGroupName' and 'KafkaManagementNodeSize' to support Kafka Rest Proxy.

Reference: https://www.powershellgallery.com/packages/Az.HDInsight/4.0.0


You can try to create HDInsight cluster using the examples mentioned here: https://docs.microsoft.com/en-us/powershell/module/az.hdinsight/new-azhdinsightcluster?view=azps-5.5.0#examples

 # Primary storage account info
         $storageAccountResourceGroupName = "Group"
         $storageAccountResourceId = "yourstorageaccountresourceid"
         $storageAccountName = "yourstorageacct001"
         $storageAccountKey = Get-AzStorageAccountKey `
             -ResourceGroupName $storageAccountResourceGroupName `
             -Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | %{$_.Value}
         $storageContainer = "container002"
    
         # 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
    
         # Create the cluster
         New-AzHDInsightCluster `
             -ClusterType Hadoop `
             -ClusterSizeInNodes 4 `
             -ResourceGroupName $clusterResourceGroupName `
             -ClusterName $clusterName `
             -HttpCredential $clusterCreds `
             -Location $location `
             -StorageAccountResourceId $storageAccountResourceId `
             -StorageAccountKey $storageAccountKey `
             -StorageContainer $storageContainer `
             -SshCredential $clusterCreds 

Hope this helps. Do let us know if you any further queries.


  • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification.




· 5 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What should be the value of $storageAccountResourceId = "yourstorageaccountresourceid" ??

i tried with both ResourceGroupName and complete ResourceId

ResourceGroupName : hdinsightcli
ResourceId : /subscriptions/XXXXXXXXXXXXXXX/resourceGroups/hdinsightcli

every time I am getting same error as below .



New-AzHDInsightCluster: Operation returned an invalid status code 'BadRequest'

0 Votes 0 ·

Hello @KareemAbdul-1982,

After creating a storage account, do wait for 5-10 minutes and run the powershell script will resolve the issue.

Where do you find the$storageAccountResourceId?

Goto Storage Account created => Properties => Storage account Resource ID: Copy and paste in the PowerShell script.

67264-image.png

I'm able to create the HDInsight cluster using the same PowerShell script provided above:

67167-image.png

Hope this helps. Do let us know if you any further queries.


Do click on Accept Answer and Upvote on the post that helps you, this can be beneficial to other community members.


0 Votes 0 ·
image.png (89.8 KiB)
image.png (310.4 KiB)

Hello @KareemAbdul-1982,

Just checking in to see if the above answer helped. If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·
Show more comments
KareemAbdul-1982 avatar image
0 Votes"
KareemAbdul-1982 answered ·

Primary storage account info

      $storageAccountResourceGroupName = "datafence-storage-rg"
      $storageAccountResourceId = "/subscriptions/XXXXXXXXXXXXXXXXXXXXXXXXX/resourceGroups/datafence-storage-rg/providers/Microsoft.Storage/storageAccounts/datafencestorage123"
      $storageAccountName = "datafencestorage123"
      $storageAccountKey = Get-AzStorageAccountKey `
          -ResourceGroupName $storageAccountResourceGroupName `
          -Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | %{$_.Value}
      $storageContainer = "container002"
    
      # Cluster configuration info
      $location = "East US"
      $clusterResourceGroupName = "datafence-storage-rg"
      $clusterName = "hdinsightcluster"
      $clusterCreds = Get-Credential
    
      # If the cluster's resource group doesn't exist yet, run:
      # New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
    
      # Create the cluster
      New-AzHDInsightCluster `
          -ClusterType Hadoop `
          -ClusterSizeInNodes 4 `
          -ResourceGroupName $clusterResourceGroupName `
          -ClusterName $clusterName `
          -HttpCredential $clusterCreds `
          -Location $location `
          -StorageAccountResourceId $storageAccountResourceId `
          -StorageAccountKey $storageAccountKey `
          -StorageContainer $storageContainer `
          -SshCredential $clusterCreds
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.