I wanted to create folders and sub-folders, I found this workaround: but when I listed them: using this code (source):
foreach (IListBlobItem item in Container.ListBlobs(null, false))
{
if (item.GetType() == typeof(CloudBlockBlob))
{
CloudBlockBlob blob = (CloudBlockBlob)item;
Console.WriteLine("Block blob of length {0}: {1}", blob.Properties.Length, blob.Uri);
}
else if (item.GetType() == typeof(CloudPageBlob))
{
CloudPageBlob pageBlob = (CloudPageBlob)item;
Console.WriteLine("Page blob of length {0}: {1}", pageBlob.Properties.Length, pageBlob.Uri);
}
else if (item.GetType() == typeof(CloudBlobDirectory))
{
CloudBlobDirectory directory = (CloudBlobDirectory)item;
Console.WriteLine("Directory: {0}", directory.Uri);
}
}
It only shows parent folders and blobs in the root container. I was expecting to get them all as blobs since this is virtual directory not real, for example I have this file
https://account.blob.core.windows.net/container/Accounts/Images/1/acc.jpg
but it doesn't show, it just show:
https://account.blob.core.windows.net/container/Accounts
and
https://account.blob.core.windows.net/container/anyfile
Do I have to request sub-folders inside parent folders to reach the file?