Getting list of names of Azure blob files in a container?

前端 未结 8 1647
醉酒成梦
醉酒成梦 2020-12-15 15:31

I need to list names of Azure Blob file names. Currently I m able to list all files with URL but I just need list of names. I want to avoid parsing names. Can you please see

8条回答
  •  佛祖请我去吃肉
    2020-12-15 16:06

    This works with WindowsAzure.Storage 9.3.3.

    CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
    var cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
    
    var blobResultSegment = await cloudBlobContainer.ListBlobsSegmentedAsync(continuationToken);
    var blobs = blobResultSegment.Results.Select(i => i.Uri.Segments.Last()).ToList();
    

提交回复
热议问题