0
以下代码直到昨天才正常工作,但今天它正在给我一个如下所述的错误。将StorageAccount密钥传递到新的上下文时出错
$StorageAccountName = "xyz"
$StorageAccountKey = Get-AzureRmStorageAccountKey -StorageAccountName $StorageAccountName
$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey $StorageAccountKey.Primary
试图与
$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey $StorageAccountKey.key1
这里替换上面代码的最后一行的错误:
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.
这已经工作,但缺乏riosity想知道使用'$ StorageAccountKey.Primary'或'$ StorageAccountKey.key1' –
这个问题,我已经给你解释了。 '$ StorageAccountKey'对象不再具有这些属性,您可以检查自己,执行'| gm'然后看。 – 4c74356b41