Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot get Storage Key" exception thrown #19

Open
bcraun opened this issue Jul 7, 2016 · 1 comment
Open

"Cannot get Storage Key" exception thrown #19

bcraun opened this issue Jul 7, 2016 · 1 comment

Comments

@bcraun
Copy link

bcraun commented Jul 7, 2016

Am trying to stand up the cluster using the PS prepare.ps1 script and am seeing the following error. Have tried multiple times. Any ideas?

2016-07-07T07:46:36.7815892-07:00 [INFO] [CreateStorageAccountARM.ps1(ln:54)] - Getting Storage Key for iot201607070742
2016-07-07T07:46:37.0940803-07:00 [INFO] [CreateStorageAccountARM.ps1(ln:59)] - Storage Account: iot201607070742 successfully created in Resource Group: iot-group-201607
070742 at Location: Central US. Time: 33.2957405 secs
Cannot get Storage Key
At C:\projects\hdinsight-storm-examples\scripts\azure\CreateAzureResources.ps1:207 char:5
+     throw "Cannot get Storage Key"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Cannot get Storage Key:String) [], RuntimeException
    + FullyQualifiedErrorId : Cannot get Storage Key

PS C:\projects\hdinsight-storm-examples\IotExample>
@davidrpk
Copy link

davidrpk commented Jan 18, 2017

The new version of Azure Powershell returns the Storage Key in a slightly different format. See here for more info: http://www.codeisahighway.com/breaking-change-with-get-azurermstorageaccountkey-in-azurerm-storage-v1-1-0-azurerm-v1-4-0/

To get around this modify line 55 in scripts\azure\Storage\CreateStorageAccountARM.ps1 to the following:

$PrimaryKey = $(Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -StorageAccountName $AccountName)[0].Value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants