Get file names from different folders and combine them into one variable in ADF

Zhu, Yueli YZ [NC] 255 Reputation points
2025-03-10T17:16:24.1966667+00:00

I have 100 folders: f1-f100, each folders have many different csv files. How to get all the csv files' names together,in a list, like results in one variable? Thanks a lot

source in a storage blob container like below:

 f1: test1.csv, test2.csv

 f2:test2.csv,

 f3: test3.csv,test4.csv, test5.csv

   ...

 f100: test1001:csv,test1002:csv,test1003:csv

expected result below:

{

"name": "file_names",

"value": [

	"test1.csv",

	"test2.csv",

	...

	"test1001.csv",

	"test1002.csv",

	"test1003.csv"

]

}

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,333 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Nandan Hegde 34,351 Reputation points MVP
    2025-03-11T03:42:04+00:00

    Please refer the below blog for step by step detail to achieve the goal :

    https://datasharkx.wordpress.com/2023/02/06/calculate-folder-size-of-an-azure-blob-storage-data-lake-storage-via-synapse-data-factory-pipeline/

    you need a combination of for each activity and get meta data activity to get list of all files within all folders recursively.

    Note : rather than getting the file size and adding it up, you can use append variable activity and append the file names to an array variable .

    Then take a union of the variable with itself at the end after all iterations to remove the duplicate values and get the unique file names

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.