
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get Azure Storage Container Blobs using PowerShell
To get blobs inside the Azure storage container using PowerShell, we will use the Get-AzStorageBlob command. . Before running this command, we need to make sure that the Azure cloud account is connected (Connect-AzAccount) and the proper subscription is set in which the storage account resides (Set-AzContext).
To work with the storage accounts we first need to set the Context for it and we will use the storage account key to set the context.
$rg = "az204" $storageaccount = "az204storage05june" $key = (Get-AzStorageAccountKey -ResourceGroupName $rg - Name $storageaccount)[0].Value $context = New-AzStorageContext -StorageAccountName $storageaccount - StorageAccountKey $key
We have now created the Azure storage context. To get the Azure files (blobs) in the particular container, we will use the below command.
Get-AzStorageBlob -Container 'container1' -Context $context
Output
This is how you can retrieve the Azure blobs from the storage container.
Advertisements