Folders in azure storage account are not deleted even after all blobs of the folders are deleted

SIGMA P35 1 Reputation point
I have a blob container in Azure called UploadedFiles. It has folders and the folder has some blobs. Even after all the blobs are deleted,the folder is still visible. How that folder will disappear?

CloudBlobDirectory directory = GetContainerHandle(eContainer).GetDirectoryReference(strVirtualDirectory);

foreach (CloudBlockBlob blockBlob in directory.ListBlobs()) {
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,513 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,265 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SaiKishor-MSFT 17,141 Reputation points

    @SIGMA P35 Thank you for reaching out to Microsoft Q&A. I understand that you are having issues where after deleting all the Blobs insider a container, the container stays in the account, is that right?

    Deleting the Blobs does not delete the container automatically, you will need to delete the container manually-


    Is this what you are looking for? Please do let me know. Thank you!