Folders don't really exist in blob storage, they are just a part of the path to a blob. If you delete all blobs under a folder, the folder will no longer exist.
How to delete empty folder on Azure Storage Explorer from powershell script
Hi,
I'm trying to delete the empty folders for managing shares ASE blobs.
From scouring the internet I've found anything that super straight forward.
Am looking for something along the line.
az login (to get the cred for current user)
azcopy remove "folder" from "blob URL"
Sites I came across that require a whole lot more set up that I wasn't able to complete.
https://stackoverflow.com/questions/49844535/delete-a-folder-in-azure-blob-storage
- script no longer available from shared link
- wasn't able to find the right module to install for the cmdlet "Get-AutomationPSCredential", and I think the "newer" version is now "Get-AzAutomationCredential" ?
- https://stackoverflow.com/questions/50534150/delete-all-files-from-azure-storage-subcontainer-using-powershell, wasn't able to use the cmdlet mentioned.
Looking for any guidance.
2 answers
Sort by: Most helpful
-
-
Sumarigo-MSFT 47,471 Reputation points Microsoft Employee
2022-05-16T12:15:06.29+00:00 @Hsin Chen Adding more information to the above response!
Azure Blob storage does not have a concept of folders and everything inside the container is considered a blob including the folders. You can easily delete a folder including all its contents in Storage Explorer. Otherwise you will need to fetch a list of everything you wish to delete and run those through a loop to delete. For more programmatic solutions please check this thread.
Please let us know if you have any further queries. I’m happy to assist you further.
----------
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.