Azure 数据工厂 - 在动态内容中使用系统变量

Azure Data Factory - Use system variable in Dynamic Content

我正在尝试在动态内容字段中使用系统变量“@pipeline().TriggerTime”。

我有一个 'Copy Data' activity,它有一个文件夹的接收器数据集。

在这个 Sink 数据集中,我尝试将文件路径设置为

@concat('Trigger_',formatDateTime(@pipeline().TriggerTime, 'ddMMyyyyHHmmss'), '.trg')

但我收到以下错误消息。

activity 包含在 'If Condition' 块中,该块本身包含在 'ForEach' 中,但是这个变量在管道中应该是全局的,所以我不明白为什么它应该没用。

感谢您的帮助。

正如 Joel 评论的那样,只需将“@pipeline”更改为“pipeline”即可。

@concat('Trigger_',formatDateTime(pipeline().TriggerTime, 'ddMMyyyyHHmmss'), '.trg')

如果要使用多个功能,只需在开头添加@即可。 如果要获取函数的字符串,需要加双@,比如"Answer is: @@{pipeline().parameters.myNumber}" return the string Answer is: @{pipeline ().parameters.myNumber}.

更详细的可以参考这个documentation.