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

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

通过 Azure 数据工厂,你可以在开发数据集成解决方案时以迭代方式开发和调试数据工厂管道。Azure Data Factory lets you iteratively develop and debug Data Factory pipelines as you are developing your data integration solutions. 这些功能使你能够在创建拉取请求或将其发布到数据工厂服务之前测试更改。These features allow you to test your changes before creating a pull request or publishing them to the data factory service.

调试管道Debugging a pipeline

当你使用管道画布进行创作时,可使用“调试”功能测试活动。As you author using the pipeline canvas, you can test your activities using the Debug capability. 执行测试运行时,在选择“调试”之前,不需要将更改发布到数据工厂。 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.

管道画布上的调试功能

管道运行时,你可在管道画布的“输出”选项卡中查看每个活动的结果。As the pipeline is running, you can see the results of each activity in the Output tab of the pipeline canvas.

在管道画布的“输出” 窗口中查看测试运行的结果。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.

重要

选择”调试” 会实际运行管道。Selecting Debug actually runs the pipeline. 例如,如果管道包含复制活动,则测试运行会将数据从源复制到目标。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.

设置断点Setting breakpoints

Azure 数据工厂还允许你一直调试管道,直到到达管道画布中的某个特定活动。Azure Data Factory allows for you to debug a pipeline until you reach a particular activity on the pipeline canvas. 在活动上放置要测试到的断点,然后选择“调试”即可。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.

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

监视调试运行Monitoring debug runs

运行管道调试运行时,结果将显示在管道画布的“输出”窗口中。When you run a pipeline debug run, the results will appear in the Output window of the pipeline canvas. “输出”选项卡只包含在当前浏览器会话过程中出现的最新运行。The output tab will only contain the most recent run that occurred during the current browser session.

管道画布“输出”窗口

若要查看调试运行的历史视图或查看所有活动调试运行的列表,你可以进入“监视器”体验。To view a historical view of debug runs or see a list of all active debug runs, you can go into the Monitor experience.

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

备注

Azure 数据工厂服务仅将调试运行历史记录保留 15 天。The Azure Data Factory service only persists debug run history for 15 days.