Error Code 3701 - Channel was Closed in Azure Data Factory
WHAT HAPPENED?
Recently while using the Delete Activity to delete files on an SFTP, I had this error(below) which wasn’t too helpful. The error message is very generic and took me sometime to figure out what was going on. If you are suffering from the same error then read on.

A little background on my process - I was trying to delete all files in a directory on the SFTP after I’ve processed the files.
MY SETUP
My Dataset is setup as below -

As you can see I am using the folder path and file name as parameters into the dataset. In short pretty standard dynamic dataset for SFTP.
HOW TO RESOLVE THE ISSUE:
My initial setup for the Delete Activity > Source section was that I set the fileName parameter as . to delete everything in the /OUT directory.

The above setup led to the error shown above as it wasn’t able to find a file with the name . - which was a DUH ! moment as the fileName parameter is looking for an exact match. To fix this, I had to change the fileName and the File path Type as follows to make it work -

That is it folks - sometimes we do make silly mistakes, but it is what we learn from these mistakes is what makes us a better developer(and also better worded error message would have helped!)
Until next time, Happy Coding !