c# - 仅获取容器中 Azure blob 文件的所有名称?

标签 c# .net azure blob azure-blob-storage

我想要容器中 Azure Blob 文件中的所有名称(出于特定目的)。我发现了一些类似的问题,甚至在 stackoverflow.com ( getting list of names of Azure blob files in a container? ) 上都有一个。但所有这些答案都首先使用 ListBlobs() 方法。这就是我想要防止的,因为有 24,000 个文件,大约需要 10 分钟才能将所有文件存储在列表中并从每个文件接收名称。我现在在 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.

Is this possible??

不,这是不可能的。您需要调用 ListBlobs 来获取容器中所有 Blob 的列表。

关于c# - 仅获取容器中 Azure blob 文件的所有名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42647954/

相关文章:

python - 当尝试使用 pythonnet 从脚本构建 exe 时,py2exe 失败并显示 "No module named ' clr'"

java - 如何使用 Log4j 将自定义属性记录到 AppInsight?

python - Visual Studio 中的一个项目有多个团队 - 不好的做法?

c# - 查找丢失的鼠标点击

c# - 密码学.NET,避免定时攻击

c# - 每组操作的可重用 ObjectContext 或新的 Object Context?

azure - 为什么 Visual Studio Online 上的 Docker "Build an image"步骤失败?

c# - 将 SOAP 作为文本转储到文件

c# - 一个asp.net页面结构问题

C# DriveInfo 类导致窗口弹出错误