How can I move a file from one folder to another?

Balachandran Kannan 181 Reputation points
2021-03-18T19:47:34.947+00:00

I am using ADF to process data that is dropped on to a container/folder. Once the file is available ADF will consume it and load it to a SQL Table using Copy activity. At the end of pipeline run, I need to move that file to a different container instead of deleting it. Which activity helps in this scenario?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,087 questions
0 comments No comments
{count} votes

Accepted answer
  1. KranthiPakala-MSFT 46,437 Reputation points Microsoft Employee
    2021-03-18T21:27:43.213+00:00

    Hi @Balachandran Kannan ,

    Thanks for reaching out. After copying file data from Container to SQL table, have another subsequent Copy Activity and create a new Binary data set which points to the original file which you would want to copy to different container as shown below. This will make a copy of the file in desired destination but the source container/folder will still have the source file.

    In case if you want to delete the source file from original source (which is nothing but moving file) after copying to another archive folder or container then you will need to use binary dataset which will have deleteFilesAfterCompletion property and that needs to be set to true.

    79336-image.png

    Additional info: Please refer to this MS doc: Move files with Azure Data Factory

    Hope this info helps. Do let us know if you have further query.

    ----------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful