List directories in a container

99封情书 提交于 2019-12-23 17:05:26

问题


How can I get a list of directories in my container?

I can use Get-AzureStorageBlob to get all the blobs and filter by distinct prefix /name/, but it might be slow with millions of blobs.

Is there a proper way of achieving this in PowerShell?


回答1:


There's no concept of directories, only containers and blobs. A blob name may have delimiters with look like directories, and may be filtered.

If you choose to store millions of blobs in a container, then you'll be searching through millions of blob names, even with delimiter filtering, whether using PowerShell, SDK, or direct REST calls.

As far as "proper" way: There is no proper way: Only you can decide how you organize your containers and blobs, and where (or if) you choose to store metadata for more efficient searching (such as a database).



来源:https://stackoverflow.com/questions/37723628/list-directories-in-a-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!