How to dynamically rename files to data lake while copying from source (File share) with sub folder structure using ADF?

Frank D'Souza 1 Reputation point
2022-02-22T05:33:38.34+00:00

176698-capture-e.jpg176732-capture-f.jpg176742-capture-g.jpgHi Team,

How to dynamically rename files to data lake while copying from source (File share) with sub folder structure using ADF?

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_A.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_D.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_E.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > Folder 51 > File_B.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > Folder 52 > File_C.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_F.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_I.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_J.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > Folder 51 > File_G.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > Folder 52 > File_H.csv

The output should have files concatenated dynamically while copying from the above structure in File share and data lake should be as below.

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_A_YYYY_MM_DD.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_D_YYYY_MM_DD.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > File_E_YYYY_MM_DD.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > Folder 51 > File_B_YYYY_MM_DD.csv

Folder L01 > Folder L11 > Folder L21 > Folder L31 > Folder L41 > Folder 52 > File_C_YYYY_MM_DD.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_F_YYYY_MM_DD.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_I_YYYY_MM_DD.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > File_J_YYYY_MM_DD.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > Folder 51 > File_G_YYYY_MM_DD.csv

Folder L01 > Folder L12 > Folder L22 > Folder L32 > Folder L42 > Folder 52 > File_H_YYYY_MM_DD.csv

Note: YYYY_MM_DD is a current date which should be added while saving from file share to data lake.

Is that possible? Please suggest.

Regards,
Frank D

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,285 questions
Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,472 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,700 questions
{count} votes

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.