0
votes

I am new to ADF, i want to copy an excel from source to Achieve folder with added timestamp to the file, I tried following set up as parameters for source and target and run copy job. its just copying the file to the target not with timestamp. Not sure what to be done to fix this one right following is the target filename value @concat(replace(pipeline().parameters.pTriggerFile,'.csv',''), '_', formatDateTime(convertTimeZone(utcnow(),'UTC','Eastern Standard Time'),'yyyy-MM-ddTHHmmss'), '.csv')

Source Dataset Source dataset

Source dataset parameter Target dataset Target s Target Dataset Parameter

Source Copy ADF job

Sink ADF Job

1

1 Answers

0
votes

Follow the below steps to add a timestamp to the source filename when copying it to sink.

Source:

enter image description here

Azure data factory copy activity:

  1. In the source dataset, create a parameter for the source filename and pass it dynamically in the file path.

enter image description here

  1. In Source, create a parameter at the pipeline level and pass the filename dynamically to the dataset parameter.

enter image description here

  1. In the sink dataset, create a dataset parameter and add it dynamically to the sink file path.

enter image description here

enter image description here

  1. In the sink, pass the below dynamic content to add the current timestamp to the filename.

    @concat(replace(pipeline().parameters.sourcefilename,'.csv',''), '_', formatDateTime(convertTimeZone(utcnow(),'UTC','Eastern Standard Time'),'yyyy-MM-ddTHHmmss'), '.csv')
    

enter image description here

enter image description here

  1. When you run the pipeline, you can see the sink file has the timestamp added to it.

enter image description here