azure-data-factory

Azure Data Factory (ADF) trying to delete a csv file. Error Invalid delete activity payload with 'folderPath' that is required and cannot be empty


I have created a dataset which dynamically defines a .csv file.

enter image description here

Later on, in the false part of an if activity I try to copy the csv from one directory into a container to another directory in the same container and then delete the csv from the original dir.

The copy activity works fine using something like this to define the filepath:

@concat(variables('some_variable'),'/',pipeline().parameters.file_name)

After the copy I try to delete the above mentioned csv using the exact same filepath as above.

I receive the error message:

Invalid delete activity payload with 'folderPath' that is required and cannot be empty.

I dont see what folderPath is complaining about: enter image description here


enter image description here


Solution

  • ADLS is a little different than traditional storage. Your dataset does not specify which filesystem (container) to connect to. When referencing a dynamic file in an ADLS dataset, you should include file system (container), directory (folder path) and file name parameters:

    enter image description here

    Then assign them in the connection: enter image description here

    You can hard code values like container if the dataset will only ever be used for that container.