[Storage] How to get all directories in the container in the latest v12 .NET SDK?
See original GitHub issueHow to get all directories in the container in the latest v12 storage SDK?
I have the following structure in my blob storage:
- container1
- directory1 - file1
- directory2 - file1 - file2
- container2
I`m interested to get all directories(without files) that exist in the container1. If something were found I would like to process this directory deeper. How can I implement it?
In the v11 version we had lot of classes/methods that don`t exist in the v12. It would be good to have some manual on how to migrate to v12.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
List blobs with .NET - Azure Storage
When you call a listing operation hierarchically, Azure Storage returns the virtual directories and blobs at the first level of the hierarchy.
Read more >Is there a way to get file structure from azure blob?
I'm new to Azure and playing around with blobs in my .Net application. I want to be able to get structure with folders,...
Read more >Azure Blob Storage using a .NET Core Console Application
Create a Container. You can choise the Container name. First create a new instance of BlobServiceClient. Then call the CreateBlobContainerAsync method to create ......
Read more >Azure.Storage.Blobs 12.17.0
This client library enables working with the Microsoft Azure Storage Blob service for storing binary and text data. For this release see notes...
Read more >Get a list of blobs in a container with the v12 SDK for .NET-C
After some further research I came across the Factory Pattern, and using that I am now seeing List<Item> Items correctly populated after every...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@amnguye thanks for the example! This is what I was looking for!
Hello,
Thanks for your question!
Was there a convenience method(s) or class(es) you were referring to from the v11 library that you were looking for in the v12 library? If so what is the name of the convenience method(s) or class(es)?
To only list the directories in a blob container here’s a snippet of code I think that you could take some inspiration from.
The REST API does not allow us an option to look for just top level directories, we have to get the list of blobs and parse for directories. https://docs.microsoft.com/en-us/rest/api/storageservices/list-blobs
**Updated to use GetBlobsByHierarchyAsync