Home > Net >  How can I create the current Year/Month/Day folder dynamically in the Azure Data Factory pipeline?
How can I create the current Year/Month/Day folder dynamically in the Azure Data Factory pipeline?

Time:11-23

I'm using copy activity to send data to Azure Data Lake Gen2. I need to create a Year/Month/Day folder dynamically.

file_1.csv
file_2.csv
file_3.csv
.
-
-
file_9.csv

My question: how can I Create a Year/Month/Day folder dynamically transferring from one container to another container?

CodePudding user response:

You can use the following procedure for getting Year/Month/Day folder dynamically.

In my storage account, these are the files.

enter image description here

  • Create a copy activity with wild card path.

enter image description here

Then, go to sink -> Open sink dataset and Create dataset parameter with the name folder.

enter image description here

Go to connection, and added this dynamic content: @dataset().folder

enter image description here

Now, add this dynamic content to the dataset properties value:

@concat(formatDateTime(utcnow(), 'yyyy'), '/',formatDateTime(utcnow(),'MM'),'/',formatDateTime(utcnow(),'dd'),'/')

enter image description here

Pipeline successfully executed and got this output :

enter image description here

  • Related