biscuit765
biscuit765

Reputation: 92

How to delete folder from azure storage using node js

New to Azure storages need to delete folder from container using node js but not able to find any proper solution for node I am able to delete container

blobService.deleteContainerIfExists('test', function(error, result, response){
    if(!error){
      console.log('container deleted!')
    }
});

but not getting any solution for deleting folder inside container.I am working on a NodeJS server. Any help would be appreciated.

Upvotes: 1

Views: 1027

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29950

In azure blob storage, the folder is virtual and it's part of the blob name. So you cannot directly delete the folder.

If you want to delete the folder, first you should delete all the blobs in that folder. Then the folder will deleted as well.

Or you can use Azure Data Lake Storage Gen2, which is similar to azure blob storage, and it does support folder-delete operation.

Upvotes: 4

Related Questions