Delete from FTP using Azure Data Factory

During development of an ETL process in Azure Data Factory, you may come across a need to delete the data from FTP. It may be neccessary e.g. when you want to make place for new incoming data or you don’t want your pipeline to pull the old data twice. The solution of the problem lays in a custom activity.

Hey, I noticed that many people start to use this tutorial, so I have created a new, easier to follow version.


To create a custom activity you have to follow the steps from the Microsoft’s tutorial, which is here..

To delete the files from FTP or clean a certain catalog, you may use this C# code:

After compiling the code and uploading it to blob, the pipeline activity will look like this:

If you don’t want to include the login and the password in the activity, you will have to do so in C# code.

A simple and tested code 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *