我刚刚开始使用 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/
$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
关于powershell - Get-AzureStorageBlob 抛出找不到您的 azure 存储凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18795815/