我刚刚开始使用 Azure,在使用 PowerShell cmdlet 处理我的存储帐户时遇到问题。
我已经创建了一个存储帐户并在该存储帐户中创建了一个容器。接下来,我安装了 Azure Powershell SDK 和命令让等,并导入了publishsettings 文件。当我执行 Get-AzureSubscription 或 Get-AzureStorageAccount 命令时,它会在 PowerShell 控制台中正确显示我的订阅以及各种存储端点。
但是,如果我执行 Get-AzureStorageBlob 调用或 Set-AzureStorageBlobContent,则会收到以下错误
Get-AzureStorageBlob : Can not find your azure storage credential. Please set current storage account using
"Set-AzureSubscription" or set the "AZURE_STORAGE_CONNECTION_STRING" environment variable.
我真的是束手无策了。对此错误字符串的 Google 搜索只会显示对 Github 等上代码的引用。非常感谢一些帮助。
是的,所以我终于成功做到了!以下是有关如何使用 PowerShell 在 Azure 中创建 blob 并在其中存储文件的总体详细信息。
http://www.nikgupta.net/2013/09/azure-blob-storage-powershell/ http://www.nikgupta.net/2013/09/azure-blob-storage-powershell/
$context = New-AzureStorageContext -StorageAccountName FunkyStorage -StorageAccountKey {Enter your storage account key here}
Set-AzureStorageBlobContent -Blob "MyFunkyBlob" -Container FunkyContainer-File "c:\temp\1.txt" -Context $context -Force
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)