使用 Azure 数据工厂进行迭代开发和调试Iterative development and debugging with Azure Data Factory

Azure 数据工厂允许以迭代方式开发和调试数据工厂管道。Azure Data Factory lets you iteratively develop and debug Data Factory pipelines.

有关此功能的 8 分钟简介和演示,请观看以下视频:For an eight-minute introduction and demonstration of this feature, watch the following video:

迭代的调试功能Iterative debugging features

使用管道画布中的调试功能创建管道并执行测试运行,不需要编写一行代码。Create pipelines and do test runs using the Debug capability in the pipeline canvas without writing a single line of code.

管道画布上的调试功能

在管道画布的“输出” 窗口中查看测试运行的结果。View the results of your test runs in the Output window of the pipeline canvas.

管道画布“输出”窗口

在测试运行成功后,向管道中添加更多活动并继续以迭代方式进行调试。After a test run succeeds, add more activities to your pipeline and continue debugging in an iterative manner. 还可以在测试运行正在执行时将其取消You can also Cancel a test run while it is in progress.

取消测试运行

执行测试运行时,在选择“调试”之前,不需要将更改发布到数据工厂。 When you do test runs, you don't have to publish your changes to the data factory before you select Debug. 当希望确保更改在你更新数据工厂工作流之前按预期工作时,此功能很有帮助。This feature is helpful in scenarios where you want to make sure that the changes work as expected before you update the data factory workflow.

Important

选择”调试” 会实际运行管道。Selecting Debug actually runs the pipeline. 因此,例如,如果管道包含复制活动,则测试运行会将数据从源复制到目标。So, for example, if the pipeline contains copy activity, the test run copies data from source to destination. 因此,在调试时,建议在复制活动和其他活动中使用测试文件夹。As a result, we recommend that you use test folders in your copy activities and other activities when debugging. 在调试管道后,切换到要在正常操作中使用的实际文件夹。After you've debugged the pipeline, switch to the actual folders that you want to use in normal operations.

可视化调试运行Visualizing debug runs

可以在一个位置可视化数据工厂正在进行的所有调试运行。You can visualize all the debug runs that are in progress for your data factory in one place. 选择页面右上角的“查看调试运行”。 Select View debug runs in the upper right corner of the page. 在使用主管道启动子管道的调试运行并且希望用单个视图查看所有活动的调试运行的情况下,此功能非常有用。This feature is useful in scenarios where you have master pipelines kicking off debug runs for child pipelines, and you want a single view to see all the active debug runs.

选择查看活动调试运行图标

活动调试运行的示例列表

监视调试运行Monitoring debug runs

通过调试功能启动的测试运行不会显示在“监视器”选项卡上的列表中。 在“监视器”选项卡上,只能查看通过“立即触发”、“计划”或“翻转窗口”触发器触发的运行。 可以在管道画布的“输出”窗口中查看通过调试功能启动的最后一个测试运行。 The test runs initiated with the Debug capability are not available in the list on the Monitor tab. You can only see runs triggered with Trigger Now, Schedule, or Tumbling Window triggers in the Monitor tab. You can see the last test run initiated with the Debug capability in the Output window of the pipeline canvas.

设置用于调试的断点Setting breakpoints for debugging

数据工厂还允许一直调试到管道画布中的某个特定活动。Data Factory also lets you debug until you reach a particular activity on the pipeline canvas. 只需要在活动上放置要测试到的一个断点,然后选择“调试”即可。 Just put a breakpoint on the activity until which you want to test, and select Debug. 数据工厂会确保测试仅运行到管道画布上的断点活动。Data Factory ensures that the test runs only until the breakpoint activity on the pipeline canvas. 如果不想测试整个管道,只想测试该管道内的一部分活动,则此“调试至” 功能非常有用。This Debug Until feature is useful when you don't want to test the entire pipeline, but only a subset of activities inside the pipeline.

管道画布上的断点

若要设置断点,请选择管道画布上的元素。To set a breakpoint, select an element on the pipeline canvas. “调试至” 选项在元素的右上角显示为空心的红色圆圈。A Debug Until option appears as an empty red circle at the upper right corner of the element.

在所选元素上设置断点之前

选择“调试至”选项后,它将变为实心的红色圆圈,以指示已启用断点 。After you select the Debug Until option, it changes to a filled red circle to indicate the breakpoint is enabled.

在所选元素上设置断点之后