仅在容器中获取Azure Blob文件的所有名称? [英] Getting only all names of Azure blob files in container?

查看:50
本文介绍了仅在容器中获取Azure Blob文件的所有名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将Azure Blob文件中的所有名称都放在一个容器中(出于特定目的).我在stackoverflow.com(

I want all the names from the Azure Blob files in a container (for a certain purpose). I found some similar questions, even one on stackoverflow.com (getting list of names of Azure blob files in a container?). But all those answers are using the ListBlobs()-method first. That is what I want to prevent, beacause with 24,000 files, it takes about 10 minutes before all the files are stored in a list and the name is received from every file. Method I use now in C#:

            var container = GetOrCreateBlobContainer(containerName);
            var blobs = container.ListBlobs(useFlatBlobListing: true);
            var blobNames = blobs.OfType<CloudBlockBlob>().Select(b => b.Name).ToList();
            return blobNames;

我想要的是:直接从存储中获取所有名称,而无需先使用container.ListBlobs().

What I want: Get all names directly from the storage without using container.ListBlobs() first.

这可能吗?

推荐答案

我想要的是:直接从存储中获取所有名称,而无需使用container.ListBlobs()首先.

What I want: Get all names directly from the storage without using container.ListBlobs() first.

这可能吗?

否,这是不可能的.您将需要调用 ListBlobs 以获得容器中所有blob的列表.

No, it is not possible. You will need to call ListBlobs to get a list of all blobs in a container.

这篇关于仅在容器中获取Azure Blob文件的所有名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆