GET-AzureStorageBlob抛出找不到您的Azure存储凭证 [英] Get-AzureStorageBlob throws Can not find your azure storage credential

查看:266
本文介绍了GET-AzureStorageBlob抛出找不到您的Azure存储凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用Azure的开始,我现在面临使用PowerShell命令我的存储账户工作的问题。

我创建了一个存储帐户,并在存储帐户的容器。接下来,我安装了Azure的PowerShell的SDK和命令允许等,进口的publishsettings文件。当我一开始AzureSubscription或Get-AzureStorageAccount命令它正确地显示了各种存​​储终点沿着我在PowerShell控制台订阅。

但是,如果我做一个GET-AzureStorageBlob来电或一组-AzureStorageBlobContent我收到以下错误

  GET-AzureStorageBlob:找不到您的Azure存储凭证。请使用当前设置存储账户
设置-AzureSubscription或将AZURE_STORAG​​E_CONNECTION_STRING环境变量。

我是字面上的智慧在这里结束。这个错误字符串谷歌搜索只会带来高达code参考在Github等真的AP preciate一些帮助。


解决方案

右键所以我终于成功地做到这一点!下面是关于如何使用PowerShell创建在Azure中的BLOB和存储文件有整体细节。

<一个href=\"http://www.nikgupta.net/2013/09/azure-blob-storage-powershell/\">http://www.nikgupta.net/2013/09/azure-blob-storage-powershell/


  $ =背景下新AzureStorageContext -StorageAccountName FunkyStorage -StorageAccountKey {请输入您的存储帐户关键}SET-AzureStorageBlobContent -BlobMyFunkyBlob - 集装箱FunkyContainer-文件C:\\ TEMP \\ 1.txt的-Context $语境-Force


I have just started using Azure and I am facing issues using the PowerShell cmdlets to work with my storage account.

I have created a Storage account and a container in that storage account. Next I installed the Azure Powershell SDK and command lets etc. and imported the publishsettings file. When I do the Get-AzureSubscription or Get-AzureStorageAccount command it correctly shows my subscription in the PowerShell console along with various storage end points.

However if I do a Get-AzureStorageBlob call or a Set-AzureStorageBlobContent I get the following error

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.

I am literally at wits ends here. A Google search on this error string only brings up references to code on Github etc. Would really appreciate some help.

解决方案

Right so I finally managed to do this! Here is the overall details on how to use PowerShell to create a blob in Azure and store a file there.

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

这篇关于GET-AzureStorageBlob抛出找不到您的Azure存储凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆