Skip to content

Question: Delete all files from the Data Lake Storage Gen2 container #20884

@yahorsi

Description

@yahorsi

Hi Guys,

I might be blind but I cannot find a simple way to delete all files from the Data Lake Storage Gen2 container.
My use case is static website deployment. I use Data Lake Storage Gen2 as it makes it easier to work with folders.
For the simple NOT Data Lake Storage Gen2 account I can use az storage blob delete-batch but if I use it for the
Data Lake Storage Gen2 account container fails with the error below.
Is az storage blob delete-batch supposed to work with Data Lake Storage Gen2 based containers?

ERROR: Client-Request-ID=ab4b8793-6a68-11ec-b1bc-cdece7624657 Retry policy did not allow for a retry: Server-Timestamp=Fri, 31 Dec 2021 18:37:11 GMT, Server-Request-ID=14a0ddf1-c01e-0042-0375-fee68d000000, HTTP status code=409, Exception=This operation is not permitted on a non-empty directory. ErrorCode: DirectoryIsNotEmpty<?xml version="1.0" encoding="utf-8"?><Error><Code>DirectoryIsNotEmpty</Code><Message>This operation is not permitted on a non-empty directory.RequestId:14a0ddf1-c01e-0042-0375-fee68d000000Time:2021-12-31T18:37:12.5797082Z</Message></Error>.
ERROR: This operation is not permitted on a non-empty directory. ErrorCode: DirectoryIsNotEmpty
<?xml version="1.0" encoding="utf-8"?><Error><Code>DirectoryIsNotEmpty</Code><Message>This operation is not permitted on a non-empty directory.
RequestId:14a0ddf1-c01e-0042-0375-fee68d000000
Time:2021-12-31T18:37:12.5797082Z</Message></Error>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions