Azure 数据工厂支持的系统变量System variables supported by Azure Data Factory

适用于:是 Azure 数据工厂是 Azure Synapse Analytics(预览版)APPLIES TO: yesAzure Data Factory yesAzure Synapse Analytics (Preview)

本文介绍了 Azure 数据工厂支持的系统变量。This article describes system variables supported by Azure Data Factory. 定义数据工厂实体时,可以在表达式中使用这些变量。You can use these variables in expressions when defining Data Factory entities.

管道范围Pipeline scope

可以在管道 JSON 中的任何位置引用这些系统变量。These system variables can be referenced anywhere in the pipeline JSON.

变量名Variable Name 说明Description
@pipeline().DataFactory@pipeline().DataFactory 在其中运行管道运行的数据工厂的名称Name of the data factory the pipeline run is running within
@pipeline().Pipeline@pipeline().Pipeline 管道的名称Name of the pipeline
@pipeline().RunId@pipeline().RunId 特定管道运行的 IDID of the specific pipeline run
@pipeline().TriggerType@pipeline().TriggerType 调用管道的触发器类型(手动、计划程序)Type of the trigger that invoked the pipeline (Manual, Scheduler)
@pipeline().TriggerId@pipeline().TriggerId 调用管道的触发器 IDID of the trigger that invokes the pipeline
@pipeline().TriggerName@pipeline().TriggerName 调用管道的触发器名称Name of the trigger that invokes the pipeline
@pipeline().TriggerTime@pipeline().TriggerTime 触发器调用管道的时间。Time when the trigger that invoked the pipeline. 触发时间是指实际触发的时间而不是计划时间。The trigger time is the actual fired time, not the scheduled time. 例如,返回 13:20:08.0149599Z 而不是 13:20:00.00ZFor example, 13:20:08.0149599Z is returned instead of 13:20:00.00Z

计划触发器范围Schedule Trigger scope

如果触发器的类型为以下值,则可以在触发器 JSON 中的任何位置引用这些系统变量:“ScheduleTrigger”。These system variables can be referenced anywhere in the trigger JSON if the trigger is of type: "ScheduleTrigger."

变量名Variable Name 说明Description
@trigger().scheduledTime@trigger().scheduledTime 触发器计划调用管道运行的时间。Time when the trigger was scheduled to invoke the pipeline run. 例如,对于每 5 分钟触发一次的触发器,此变量将分别返回 2017-06-01T22:20:00Z2017-06-01T22:25:00Z2017-06-01T22:30:00ZFor example, for a trigger that fires every 5 min, this variable would return 2017-06-01T22:20:00Z, 2017-06-01T22:25:00Z, 2017-06-01T22:30:00Z respectively.
@trigger().startTime@trigger().startTime 触发器实际触发调用管道运行的时间。Time when the trigger actually fired to invoke the pipeline run. 例如,对于每 5 分钟触发一次的触发器,此变量可能分别返回类似此 2017-06-01T22:20:00.4061448Z2017-06-01T22:25:00.7958577Z2017-06-01T22:30:00.9935483Z 的内容。For example, for a trigger that fires every 5 min, this variable might return something like this 2017-06-01T22:20:00.4061448Z, 2017-06-01T22:25:00.7958577Z, 2017-06-01T22:30:00.9935483Z respectively. (注意:默认情况下,时间戳采用 ISO 8601 格式)(Note: The timestamp is by default in ISO 8601 format)

翻转窗口触发器范围Tumbling Window Trigger scope

如果触发器的类型为以下值,则可以在触发器 JSON 中的任何位置引用这些系统变量:“TumblingWindowTrigger”。These system variables can be referenced anywhere in the trigger JSON if the trigger is of type: "TumblingWindowTrigger." (注意:默认情况下,时间戳采用 ISO 8601 格式)(Note: The timestamp is by default in ISO 8601 format)

变量名Variable Name 说明Description
@trigger().outputs.windowStartTime@trigger().outputs.windowStartTime 在触发器计划调用管道运行时启动窗口。Start of the window when the trigger was scheduled to invoke the pipeline run. 如果翻转窗口触发器的频率为“每小时”,则这将是小时开始时的时间。If the tumbling window trigger has a frequency of "hourly" this would be the time at the beginning of the hour.
@trigger().outputs.windowEndTime@trigger().outputs.windowEndTime 在触发器计划调用管道运行时结束窗口。End of the window when the trigger was scheduled to invoke the pipeline run. 如果翻转窗口触发器的频率为“每小时”,则这将是小时结束时的时间。If the tumbling window trigger has a frequency of "hourly" this would be the time at the end of the hour.

后续步骤Next steps

有关这些变量如何用于表达式的信息,请参阅表达式语言和函数For information about how these variables are used in expressions, see Expression language & functions.