Delete a directory in DBFS recursively from Azure
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 04:22 AM
I have an Azure storage mounted to DBFS. I want to delete a directory inside recursively. I tried both,
dbutils.fs.rm(f"/mnt/data/to/delete", True)and
%fs rm -r /mnt/data/to/deleteIn both cases I get the following exception:
AzureException: hadoop_azure_shaded.com.microsoft.azure.storage.StorageException: This operation is not permitted on a non-empty directory.
Caused by: StorageException: This operation is not permitted on a non-empty directory.How can I delete a directory recursively?
Thanks!