I have some .png files inside a Blob Container, I'm able to retrieve a file by passing the filename as a parameter :
var blob = container.GetBlockBlobReference(System.IO.Path.GetFileName(fileName));
But I want to query that Blob Container and have a list of all the files that it contains. How would I do that?
public class FilesController : Controller
{
private CloudBlobContainer container;
private CloudStorageAccount storageAccount;
private CloudBlobClient blobClient;
private CloudTableClient tableClient;
public FilesController()
{
this.storageAccount = CloudStorageAccount.Parse(_dbConnection.ConnectionAzure);
this.storageAccount.CreateCloudBlobClient();
this.blobClient = storageAccount.CreateCloudBlobClient();
this.container = blobClient.GetContainerReference("public/MyFolder");
this.tableClient = storageAccount.CreateCloudTableClient();
}
public ActionResult MyMethod(string fileName)
{
var blob = container.GetBlockBlobReference(System.IO.Path.GetFileName(fileName));
}