'Azure Data Factory Dynamic Content Filename Syntax

In a copy process going from one storage account to another I am trying to pick up the filenames in the sours and add the date to the filename in the destination so that each file copied is unique and no files are overwritten in the destination but I can't seem to get the syntax for filenames right. Welcome any suggestions on where are good examples to learn from.

Thanks



Solution 1:[1]

  1. Parameterize the source file name in the source dataset and get the files list using the Get Metadata activity from the source folder.

enter image description here

Get Metadata output:

enter image description here

  1. Pass the Get Metadata output child items to ForEach activity.

@activity('Get Metadata1').output.childItems

enter image description here

  1. Inside ForEach activity, add copy data activity to copy files from source to sink.

  2. In Copy activity source, pass the current item as source file name dataset parameter.

enter image description here

  1. Parameterize sink file name in sink dataset. In Copy activity sink, pass the expression to include date value in the file name.

Sink dataset:

enter image description here

Copy activity sink:

@concat(replace(item().name,'.csv',''),'_',formatDateTime(utcnow(),'yyyyMMdd HHmmss'),'.csv')

enter image description here

  1. Output:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NiharikaMoola-MT