Hi guys,
I'm trying to get the files metadata or at least the name of the files from the blob storage.
I keep getting the following error, could you please tell me what I am doing wrong?
Get-AzureStorageBlob : Could not get the storage context. Please pass in a storage context or set the current storage context.
At line:16 char:10
+ $blobs = Get-AzureStorageBlob -Container $ContainerName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureStorageBlob], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlobCommand
Here is my PS Syntax.
Clear-Host $SubscriptionName = "MySubscriptionName" $StorageAccountName = "MyStorageAccountName" $StorageAccountKey = "MyStorageAccountKey" $ContainerName = "MyContainerName" #Set up the storage account context $ctx = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey Get-AzureStorageContainer -Context $ctx $blobs = Get-AzureStorageBlob -Container $ContainerName $blobs
Codernater