Get-AzureStorageBlob throws Cannot Find Your Azure Credentials

I just started using Azure, and I have to deal with problems using PowerShell cmdlets to work with my storage account.

I created a vault account and a container in this vault account. Then I installed the Azure Powershell SDK and gave the command, etc. And imported the publication file. When I make a Get-AzureSubscription or Get-AzureStorageAccount command, it correctly displays my subscription in the PowerShell console along with various storage endpoints.

However, if I make a call to Get-AzureStorageBlob or 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'm literally at the tips here. A Google search on this error line only causes code links on Github, etc. Really appreciate some help.

+9
powershell azure azure-storage-blobs
Sep 13 '13 at
source share
3 answers

That's right, so I was finally able to do it! The following is general information on how to use PowerShell to create a blob in Azure and save the 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 
+20
Sep 14 '13 at
source share

You may need to set up a β€œcurrent” subscription. To do this, you must run Select-AzureSubscription .

If you run Get-AzureSubscription , you will see all subscriptions in the publication settings. One of these signatures must be set as the default. When you look at the list of results, you will see one IsDefault property for each subscription set to True or False . If the subscription is set to False , run:

Select-AzureSubscription -SubscriptionName mysub

We hope that the problem will be resolved.

+3
Sep 14 '13 at 0:26
source share

Just a quick FYI: you can do it yet (and faster). I am building a web language on top of Windows PowerShell that integrates heavily with Azure. It was called PowerShell Pipeworks .

You can use 4 cmdlets to interact with blocks:

  • Get blob
  • Import Blob
  • Export blob
  • Remove blob

Everyone takes the value -StorageAccount and -StorageKey, as well as -StorageAccountSetting and -StorageKeySetting. You can save credits to disk (or use in a web application using Add-SecureSetting). When a blob cmdlet has a storage account, it will continue to reuse it.

Export-Blob is also convenient in that you can connect to it in a directory, and it will create the correct types of content and provide -Public, which will mark the container in which it is stored as open.

These cmdlets are older (~ 3 months) than Azure, and still about 3/4 of the time to execute (I believe the main reason for this is their slow credential search), and it's worth a try.

+2
Sep 15 '13 at
source share



All Articles