How to copy the data from append variable activity to a csv file using Azure Data Factory
I have array of file names stored in append variable activity. I want to store all these files names inside a .CSV file in the data lake location.
For more info refer this how to compare the file names that are inside a folder (Datalake) using ADF
CodePudding user response:
- In this repro, Variable V1 (array type) is taken with values as in below image.
New variable v2 of string type is taken and value is given as
@join(variables('V1'),decodeUriComponent(' '))
This step is done to join all the strings of the array using\n (line feed)
.Then Copy activity is taken and dummy source dataset with one row is taken.
In Source, New is selected and value is given as dynamic content
@varaiables('v2')
.
- Sink dataset is created for CSV file.
- In Mapping, import schemas is clicked and other than
col1
, all other columns are deleted.
- Then pipeline is debugged, and values got loaded in csv file.
Edited
- Variable v2 is storing all the missing file names. (False activity of IF condition)
- After for-each, Set variable is added and variable v3 (string type) is set as
@join(variables('v2'),decodeUriComponent(' '))
- Then, in copy activity, New column is added in source