能否将ADF管道RunID添加至Data Flow?求替代实现方法
能否将ADF管道RunID作为列添加到Data Flow?以及替代实现方法
Absolutely, you can add the ADF pipeline RunID as a column in your Azure Data Flow—though you can't reference it directly inside the Data Flow itself. The reason is that Data Flows run on a Spark cluster, which operates independently of the ADF pipeline's runtime context. But don't worry, there's a straightforward workaround using parameter passing:
Step 1: Create a parameter in your Data Flow
- Open your Data Flow in the ADF studio.
- Go to the Parameters tab (top-right corner, next to "Settings").
- Click New parameter, name it something like
pipelineRunID, set its type toString, and optionally add a description (e.g., "Stores the parent pipeline's RunID").
Step 2: Pass the pipeline RunID to the Data Flow activity
- In your ADF pipeline, select the Data Flow activity that calls your flow.
- Go to the Parameters tab in the activity settings.
- For the
pipelineRunIDparameter you created, assign the dynamic value:@pipeline().RunId(this pulls the current pipeline's RunID at runtime).
Step 3: Add the RunID as a column in your Data Flow
- Go back to your Data Flow, add a Derived Column transformation after your source dataset.
- Create a new column (e.g., name it
RunID). - Set the column's value to
$pipelineRunID(Data Flow uses the$prefix to reference parameters). - Connect this Derived Column step to your sink to include the RunID in your output data.
Quick Notes
- When debugging the Data Flow directly (without running the pipeline), you'll need to enter a test string value for the
pipelineRunIDparameter—since there's no active pipeline context during debug mode. - Ensure the parameter type matches the value you're passing (String is the right fit for RunID, which is a GUID string).
内容的提问来源于stack exchange,提问作者Buckcra
相关产品推荐
相关产品推荐

