Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
You may like:

Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

AzurePowerShell
Home›Azure›Get Azure Blob Storage Blob Metadata Using PowerShell

Get Azure Blob Storage Blob Metadata Using PowerShell

By SibeeshVenu
May 20, 2022
0
1
Share:

This is going to be a quick blog post. Here we will see how you can get the metadata of each blob available in your Azure storage account using PowerShell. Here I assume that you have access to your storage account and you will be asked to log in. Let’s get started.

PowerShell command to get the metadata

Here is the command to get the metadata of all of your blobs in your storage account.

# Set the Execution policy for the current session
# Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process
$containerName = ''
$subscriptionid = ''
$storageAccName = ''
Function GetAllBlobMetadata
{
# Connect to your Azure subscription
Connect-AzAccount -Subscription $subscriptionid
# Create a context object using Azure AD credentials
$ctx = New-AzStorageContext -StorageAccountName $storageAccName -UseConnectedAccount
# Get blobs
$blobs = Get-AzStorageBlob -Container $containerName -Context $ctx
## Loop through all the blobs
foreach($blob in $blobs)
{ $blobName = $blob.Name
$blob = Get-AzStorageBlob -Blob $blobName -Container $containerName -Context $ctx
$properties = $blob.BlobClient.GetProperties()
Write-Output "The metadata for the blob {$blobName}: "
Write-Output $properties.Value
}
}
GetAllBlobMetadata
view raw Get_All_Blob_Metadata.ps1 hosted with ❤ by GitHub

Set your execution policy to Process if you get any policy errors.

Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process

If you get an authorization error as follows, make sure to add a role assignment of Storage Blob Data Contributor. You can do this via Access Control (IAM) of your storage account. Read more about this role here.

PowerShell AuthorizationPermissionMismatch Error

Get-AzStorageContainer : This request is not authorized to perform this operation using this permission.
RequestId:405a7e1a-f01e-004f-3acd-6a1168000000
Time:2022-05-18T15:38:30.5034936Z
Status: 403 (This request is not authorized to perform this operation using this permission.)
ErrorCode: AuthorizationPermissionMismatch
Content:
<?xml version=”1.0″ encoding=”utf-8″?><Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using
this permission.

Once you add the role, you can try running your PowerShell command after a few minutes. Please make sure to provide the values to the variables $containerName, $subscriptionid, $storageAccName. Happy coding with PowerShell!

About the Author

I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my blog. If you like this content, consider following me here,

  • GitHub
  • medium
  • Twitter

Your turn. What do you think?

Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.

Kindest Regards

Sibeesh Venu

TagsAzureAzure StorageGet blob metadata using PowerShellpowershell
Previous Article

Deploy .net 6 App to Azure from ...

Next Article

Post Messages to Microsoft Teams Using Python

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0

SibeeshVenu

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

Related articles More from author

  • Azure

    Azure Function Job to Delete Azure Blobs from Blob Containers

    July 24, 2019
    By SibeeshVenu
  • Azure

    Why Not Secure Your Keys and Secrets? Asp Net Core with Azure Key Vault Integration

    November 18, 2020
    By SibeeshVenu
  • Web hosting Account
    Azure

    How to map your domain name to your Azure website

    June 1, 2015
    By SibeeshVenu
  • Integrating an existing Azure App Insights into your application
    Azure

    Integrate Azure App Insights in 1 Minute to .Net6 Application

    December 15, 2021
    By SibeeshVenu
  • IoTHubTrigger
    AzureIoT

    IoTHubTrigger Azure Function and Azure IoT Hub

    December 27, 2018
    By SibeeshVenu
  • Container Instance Basic Settings
    AzureDocker

    Having a Docker Container as Your Private NPM Registry – The Easy Way

    November 10, 2018
    By SibeeshVenu
0

My book

Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

YouTube

MICROSOFT MVP (2016-2022)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
  • Easily move data from one COSMOS DB to another
  • .NET 8 New and Efficient Way to Check IP is in Given IP Range
  • Async Client IP safelist for Dot NET
  • Post Messages to Microsoft Teams Using Python
  • Get Azure Blob Storage Blob Metadata Using PowerShell
  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
  • Integrate Azure App Insights in 1 Minute to .Net6 Application
  • Azure DevOps Service Connection with Multiple Azure Resource Group

Tags

Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
  • .NET
  • Achievements
  • ADO.NET
  • Android
  • Angular
  • Arduino
  • Article Of The Day
  • ASP.NET
  • Asp.Net Core
  • Automobile
  • Awards
  • Azure
  • Azure CDN
  • azure devops
  • Blockchain
  • Blog
  • Browser
  • C-Sharp Corner
  • C#
  • Career Advice
  • Code Snippets
  • CodeProject
  • Cognitive Services
  • Cosmos DB
  • CSS
  • CSS3
  • Data Factory
  • Database
  • Docker
  • Drawings
  • Drill Down Chart
  • English
  • Excel Programming
  • Exporting
  • Facebook
  • Fun
  • Gadgets
  • GitHub
  • GoPro
  • High Map
  • HighChart
  • How to
  • HTML
  • HTML5
  • Ignite UI
  • IIS
  • Interview
  • IoT
  • JavaScript
  • JQuery
  • jQuery UI
  • JQWidgets
  • JQX Grid
  • Json
  • Knockout JS
  • Linux
  • Machine Learning
  • Malayalam
  • Malayalam Poems
  • MDX Query
  • Microsoft
  • Microsoft ADOMD
  • Microsoft MVP
  • Microsoft Office
  • Microsoft Technologies
  • Microsoft Windows
  • Microsoft Windows Server
  • Mobile
  • MongoDB
  • Monthly Winners
  • MVC
  • MVC Grid
  • MySQL
  • News
  • Node JS
  • npm
  • Number Conversions
  • October 2015
  • Office 365
  • Office Development
  • One Plus
  • Outlook
  • Page
  • PHP
  • Poems
  • PowerShell
  • Products
  • Q&A
  • Raspberry PI
  • React
  • SEO
  • SharePoint
  • Skype
  • Social Media
  • Software
  • Spire.Doc
  • Spire.PDF
  • Spire.XLS
  • SQL
  • SQL Server
  • SSAS
  • SSMS
  • Storage In HTML5
  • Stories
  • Third Party Software Apps
  • Tips
  • Tools
  • Translator Text
  • Uncategorized
  • Unit Testing
  • UWP
  • VB.Net
  • Videos
  • Virtual Machine
  • Visual Studio
  • Visual Studio 2017
  • Wamp Server
  • Web API
  • Web Platform Installer
  • Webinars
  • WebMatrix
  • Windows 10
  • Windows 7
  • Windows 8.1
  • Wordpress
  • Writing

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

Contact Me

  • info@sibeeshpassion.com

Pages

  • About
  • Search
  • Privacy Policy
  • About
  • Search
  • Privacy Policy
© Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
Go to mobile version