CloudBlobContainer container = // retrieve a reference to your container BlobContinuationToken continuationToken = null; do { BlobResultSegment resultSegment = await container.ListBlobsSegmentedAsync(null, continuationToken); foreach (IListBlobItem item in resultSegment.Results) { // process each blob item in the segment } continuationToken = resultSegment.ContinuationToken; } while (continuationToken != null);
CloudBlobContainer container = // retrieve a reference to your container BlobContinuationToken continuationToken = null; do { BlobResultSegment resultSegment = await container.ListBlobsSegmentedAsync("documents/images", continuationToken); foreach (IListBlobItem item in resultSegment.Results) { // process each blob item in the segment } continuationToken = resultSegment.ContinuationToken; } while (continuationToken != null);This example demonstrates how you can retrieve only blobs in the "documents/images" folder by passing "documents/images" as the prefix parameter to ListBlobsSegmentedAsync. The method will return only blobs whose name includes the prefix string. The continuation token works the same way as in the previous example. Overall, CloudBlobContainer.ListBlobsSegmentedAsync is a useful method for retrieving blobs in a container or folder in Microsoft Azure Storage.