I have a pipeline to delete some folders from ADLS. My folder structure is as below.
/raw/MainFolder/SubfolderA/20230430/File.parquet
/raw/MainFolder/SubfolderA/20230415/File.parquet
/raw/MainFolder/SubfolderA/20230410/File.parquet
/raw/MainFolder/SubfolderB/20230430/File.parquet
/raw/MainFolder/SubfolderB/20230420/File.parquet
/raw/MainFolder/SubfolderB/20230405/File.parquet
The pipeline is currently deleting the File.parquet under the date folder. But I need it to delete the whole folder named with date (20230430).
Currently the pipeline is deleting the parquet files when they exist and erroring out when the folder is empty.
I am not passing the parquet file name to my pipeline. (Just the folder path)
I have recursively enabled in the delete activity.
Error: Failed to execute delete activity with data source ‘AzureBlobStorage’ and error ‘The required Blob is missing. Folder path: raw/MainFolder/SubfolderA/20230430/.’.
How do I get the delete activity to delete the folder itself and not just the files in it?
I am very new to Azure data factory.
Appreciate your help.
Pipeline is deleting the files but not the folders
2
Answers
Kindly make sure that the logging account is not pointing to the same folder which you are trying to delete. As while capturing the log details, delete activity will use the same folder which you have specified in the logging settings.
Here is the gif where I am using different folder for logging purpose and the folder which I am intended to delete is getting deleted along with the parquet file within it.
dev/person — I am trying to delete person folder in the below gif:
The above error will cause because of For ADLS path you are using blob storage linked service.
In blob storage you can’t delete empty directory/folder .
I also got the same error when i used blob storage linked service.
To resolve this use ADLS linked service, and to delete particular folder from ADLS irrespective of file contain in it.
Source dataset settings: folder name is
MainFolder/SubfolderA/20230430
This will delete respective folder.
before deleting folder:
After deleting folder 20230430:
Dataset.json
Pipeline.json