2016-12-05 3 views
0

次のコードは昨日までうまくいきましたが、今日は以下のようなエラーが表示されています。新しいコンテキストにStorageAccountキーを渡しているときにエラーが発生しました

$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey $StorageAccountKey.key1 

で上記のコードの最後の行を交換しようとしました

$StorageAccountName = "xyz" 
$StorageAccountKey = Get-AzureRmStorageAccountKey -StorageAccountName $StorageAccountName 
$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey $StorageAccountKey.Primary 

ここでエラーです:

New-AzureStorageContext : Cannot validate argument on parameter 'StorageAccountKey'. The argument is null or empty. 
Provide an argument that is not null or empty, and then try the command again. 

答えて

1
$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey 
$StorageAccountKey.value[0] 

あなたは簡単に$StorageAccount | Get-Member

+0

これを自分でそれを把握できはたらきましたが、cuから出ました'$ StorageAccountKey.Primary'や' $ StorageAccountKey.key1'を使ってこの問題を知りたがっていました –

+1

まあ、私はあなたに説明しました。 '$ StorageAccountKey'オブジェクトはそれらのプロパティをもはや持たず、あなた自身でチェックすることができます。 gm'と参照してください。 – 4c74356b41

関連する問題