How to delete empty folder on Azure Storage Explorer from powershell script

Hsin Chen 1 Reputation point Microsoft Employee
2022-05-07T00:40:04.783+00:00

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

Looking for any guidance.

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,715 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Cogan 10,157 Reputation points MVP
    2022-05-08T17:25:37.13+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  2. Sumarigo-MSFT 43,801 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 202308-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.