Hi Rakesh,
We have not heard you in days. Have you managed to write the code to delete a blob directory?
If not, I'd like to share my code for your reference:
public void RemoveBlobDirectory()
{
string containerName = "blobname";
string directoryName = "blobname/Images/14/";
var storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");
var blobStorage = storageAccount.CreateCloudBlobClient();
// Ensure the container is exist.
var blobContainer = blobStorage.GetContainerReference(containerName);
blobContainer.CreateIfNotExist();
foreach (IListBlobItem item in blobStorage.ListBlobsWithPrefix(directoryName))
{
if (item.GetType() == typeof(CloudBlob) || item.GetType().BaseType == typeof(CloudBlob))
{
((CloudBlob)item).DeleteIfExists();
}
}
}
Please note that the ListBlobsWithPrefix method will scan through all blob entities in order to search the result. So it will potentially have low performance when you have large number of blobs in you storage account.
Thanks,