'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]
- Parameterize the source file name in the source dataset and get the files list using the
Get Metadataactivity from the source folder.
Get Metadata output:
- Pass the Get Metadata output child items to
ForEachactivity.
@activity('Get Metadata1').output.childItems
Inside ForEach activity, add copy data activity to copy files from source to sink.
In
Copyactivity source, pass the current item as source file name dataset parameter.
- Parameterize sink file name in sink dataset. In Copy activity sink, pass the expression to include date value in the file name.
Sink dataset:
Copy activity sink:
@concat(replace(item().name,'.csv',''),'_',formatDateTime(utcnow(),'yyyyMMdd HHmmss'),'.csv')
- Output:
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 |







