Reputation: 11
I was trying to create a pipeline that copy data from S3 to Azure ADLS. And the I tried to create yyyy/mm/dd folder dynamically in Copy activity.
Like this:
@concat(
pipeline().parameters.target,
formatDateTime(utcNow(),’yyyy’,’/‘,
formatDateTime(utcNow(),’MM’,’/‘,
formatDateTime(utcNow(),’dd’),’/‘,
)
I got an error “the pipeline run failed due to an activity failure. Please check the activity grid below for more detailed information” Copy data for each activity fails.
Upvotes: 0
Views: 639
Reputation: 21
In my case I wanted to create main_folder and sub_folder ending with current date, following expression worked for me:
<main_folder>/<sub_folder_@{formatDateTime(utcnow(), 'yyMMdd')}>
just replace main_folder and sub_folder name in above statement and it should do the trick
Upvotes: 0
Reputation: 7116
Corrected expression:
@concat(
pipeline().parameters.target,
formatDateTime(utcNow(),'yyyy'),'/',
formatDateTime(utcNow(),'MM'),'/',
formatDateTime(utcNow(),'dd'),'/'
)
You can also use the simplified expression as suggested by community member in comments.
@concat(
pipeline().parameters.target,formatDateTime(utcNow(), '/yyyy/MM/dd/')
Pipeline parameters can only be used within their defining pipeline. Define dataset parameters to accept the pipeline parameter values instead.
Upvotes: 2
Reputation: 69
date +'%Y%m%d' : 20230830 --> try this and this will create folder with date(current date) dynamically in S3. Change the format according to you.
Upvotes: 0