I have a blob container in Azure called pictures
that has various folders within it (see snapshot below):
I'm trying to delete the folders titled users
and uploads
shown in the snapshot, but I keep the error: Failed to delete blob pictures/uploads/. Error: The specified blob does not exist.
Could anyone shed light on how I can delete those two folders? I haven't been able to uncover anything meaningful via Googling this issue.
Note: ask me for more information in case you need it
you can use Azure Storage Explorer (Please refer to this article about how to install it and use it.), then nav to your fileshare -> right click the folder -> select delete.
Just use Azure Storage Explorer, it has select all functionality for delete.
Blob soft delete protects an individual blob, snapshot, or version from accidental deletes or overwrites by maintaining the deleted data in the system for a specified period of time. During the retention period, you can restore a soft-deleted object to its state at the time it was deleted.
Windows Azure Blob Storage does not have the concept of folders. The hierarchy is very simple: storage account > container > blob. In fact, removing a particular folder is removing all the blobs which start with the folder name. You can write the simple code as below to delete your folders:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("your storage account"); CloudBlobContainer container = storageAccount.CreateCloudBlobClient().GetContainerReference("pictures"); foreach (IListBlobItem blob in container.GetDirectoryReference("users").ListBlobs(true)) { if (blob.GetType() == typeof(CloudBlob) || blob.GetType().BaseType == typeof(CloudBlob)) { ((CloudBlob)blob).DeleteIfExists(); } }
container.GetDirectoryReference("users").ListBlobs(true) lists the blobs start with "users" within the "picture" container, you can then delete them individually. To delete other folders, you just need to specify like this GetDirectoryReference("your folder name").
There is also a desktop storage explorer from Microsoft. It has a feature where you can select the virtual folder and then delete it effectively deleting all sub blobs.
https://azure.microsoft.com/en-us/features/storage-explorer/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With