问题描述
我希望将Azure Blob文件中的所有名称都放在一个容器中(出于特定目的).我在stackoverflow.com().但是所有这些答案都是首先使用ListBlobs()方法.我要防止的是,因为要处理24,000个文件,所以将所有文件存储在列表中并从每个文件中接收名称大约需要10分钟.我现在在C#中使用方法 :
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.
这可能吗?
推荐答案
这可能吗?
否,这是不可能的.您将需要调用 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文件的所有名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!