0
votes

I know I can get a specific file from an Azure blob container using its name, like this: CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob.txt");

Is there a way to get all the files in a List? I would like to do something like this, but unfortunately there is no such method: CloudBlockBlob blockBlobList = container.GetBlockBlobReferences(".");

2

2 Answers

2
votes

If you're interested in getting a list of all blobs in a container, you can certainly do that.

var container = storageAccount.CreateCloudBlobClient().GetContainerReference("mycontainer");
var blobs = container.ListBlobs();

blobs variable will have a list of all blobs.

0
votes

If it's CloudBlockBlobs that you want, casting could help.

var container = storageAccount.CreateCloudBlobClient().GetContainerReference("mycontainer");
var blobs = container.ListBlobs().Cast<CloudBlockBlob>();