Get Azure Blob Storage Blob Metadata Using PowerShell

Sibeesh Venu
2 min readMay 21, 2022

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.

Photo by Niklas Ohlrogge on Unsplash

PowerShell command to get the metadata

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

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!

You can always read this story on my blog here.

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,

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

--

--

Sibeesh Venu

An engineer by profession and writer by passion. Author at Sibeesh Passion, Microsoft MVP (2016–2022). Software Engineer @ Microsoft