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')
1 Answers
0
votes
Follow the below steps to add a timestamp to the source filename when copying it to sink.
Source:
Azure data factory copy activity:
- In the source dataset, create a parameter for the source filename and pass it dynamically in the file path.
- In Source, create a parameter at the pipeline level and pass the filename dynamically to the dataset parameter.
- In the sink dataset, create a dataset parameter and add it dynamically to the sink file path.
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')
- When you run the pipeline, you can see the sink file has the timestamp added to it.