Q:

Get names of all Uri inside a specific Prefix in my Blob container

I'm trying to get everything in the "10" prefix, like this:
https://ideesstorage.blob.core.windows.net/development-fotosproyectos/10/29.jpg
So far I can only get this using the directory.Uri:
https://ideesstorage.blob.core.windows.net/development-fotosproyectos/10/
The following code gets all the directories within my container and not the filenames in the prefix, as expected:
        var query = blobContainer.ListBlobs(null, false, BlobListingDetails.None);
        foreach (IListBlobItem item in query)
        {

            if (item.GetType() == typeof(CloudBlobDirectory))
            {
                CloudBlobDirectory directory = (CloudBlobDirectory)item;

                Console.WriteLine("Directory: {0}-{1}", directory.Uri, directory.Prefix);
            }
        }

What I want is for this to get the Uri of every file in the specified prefix.
Thanks in advance for your time.

A:

Take a look at the code below:
    static void ListBlobsInFolder()
    {
        var account = new CloudStorageAccount(new StorageCredentials(accountName, accountKey), true);
        var blobClient = account.CreateCloudBlobClient();
        var containerName = "<container-name>";
        var folderName = "<folder-name>";
        var container = blobClient.GetContainerReference(containerName);
        var query = container.ListBlobs(prefix:folderName, useFlatBlobListing:true, blobListingDetails:BlobListingDetails.None);
        foreach (var item in query)
        {
            Console.WriteLine(item.Uri);
        }
    }

Basically, you need to pass true for useFlatBlobListing parameter and the name of the folder as prefix ("10" in your case).

