Pet*_*ock 7 powershell blob azure azure-storage-blobs
我在Azure cmdlet中使用PowerShell来尝试简单地查看blob存储中的项目
$StorageContext = New-AzureStorageContext -StorageAccountName 'myblobname' -StorageAccountKey '2341231234asdff2352354345=='
$Container = Get-AzureStorageContainer -Name 'mycontainer' -Context $StorageContext
$blobs = Get-AzureStorageBlob -Container $Container
Error:
Get-AzureStorageBlob : Could not get the storage context. Please pass in a storage context or set the current storage context.
Run Code Online (Sandbox Code Playgroud)
我100%确定凭据是正确的(这篇文章中只是随机缩短的凭证数据)
为什么我会收到此错误?
AzureRM使用了吗?AzureRM版本列为3.8.0.我需要哪些版本的脚本才能工作?
你还需要在StorageContext这里包括:
$blobs = Get-AzureStorageBlob -Container $Container
Run Code Online (Sandbox Code Playgroud)
所以你的代码是:
$blobs = Get-AzureStorageBlob -Container $Container -Context $StorageContext
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9164 次 |
| 最近记录: |