在 Azure 逻辑应用中排查和诊断工作流故障Troubleshoot and diagnose workflow failures in Azure Logic Apps

逻辑应用生成的信息有助于诊断和调试应用中的问题。Your logic app generates information that can help you diagnose and debug problems in your app. 可以在 Azure 门户中通过查看工作流中的每个步骤来诊断逻辑应用。You can diagnose a logic app by reviewing each step in the workflow through the Azure portal. 或者,可以在工作流中增加一些步骤进行运行时调试。Or, you can add some steps to a workflow for runtime debugging.

检查触发历史记录Check trigger history

每个逻辑应用运行都以触发尝试开始,如果触发器不激发,请执行以下步骤:Each logic app run starts with a trigger attempt, so if the trigger doesn't fire, follow these steps:

  1. 通过检查触发历史记录来检查触发器的状态。Check the trigger's status by checking the trigger history. 若要查看有关触发尝试的详细信息,请选择该触发事件,例如:To view more information about the trigger attempt, select that trigger event, for example:

    查看触发器状态和历史记录

  2. 检查触发器的输入,确认它们按预期方式显示。Check the trigger's inputs to confirm that they appear as you expect. 在“输入链接”下,选择相应的链接显示“输入”窗格。 Under Inputs link, select the link, which shows the Inputs pane.

    触发器输入包括启动工作流时触发器预期需要的数据。Trigger inputs include the data that the trigger expects and requires to start the workflow. 检查这些输入有助于确定触发器输入是否正确,以及是否满足条件,使工作流能够继续。Reviewing these inputs can help you determine whether the trigger inputs are correct and whether the condition was met so that the workflow can continue.

    例如,以下 feedUrl 属性使用了错误的 RSS 源值:For example, the feedUrl property here has an incorrect RSS feed value:

    检查触发器输入中的错误

  3. 检查触发器的输出(如果有),确认它们按预期方式显示。Check the triggers outputs, if any, to confirm that they appear as you expect. 在“输出链接”下,选择相应的链接显示“输出”窗格。 Under Outputs link, select the link, which shows the Outputs pane.

    触发器输出包括触发器传递给工作流中下一步骤的数据。Trigger outputs include the data that the trigger passes to the next step in your workflow. 检查这些输出有助于确定是否已将正确或预期的值传递给工作流中的下一步骤,例如:Reviewing these outputs can help you determine whether the correct or expected values passed on to the next step in your workflow, for example:

    检查触发器输出中的错误

    提示

    如果发现有任何无法识别的内容,请详细了解 Azure 逻辑应用中不同的内容类型If you find any content that you don't recognize, learn more about different content types in Azure Logic Apps.

检查运行历史记录Check runs history

每次针对某个项或事件激发触发器时,逻辑应用引擎将针对每个项或事件创建并运行一个独立的工作流实例。Each time that the trigger fires for an item or event, the Logic Apps engine creates and runs a separate workflow instance for each item or event. 如果某个运行失败,请执行以下步骤检查该次运行过程中发生的情况,包括工作流中每个步骤的状态,以及每个步骤的输入和输出。If a run fails, follow these steps to review what happened during that run, including the status for each step in the workflow plus the inputs and outputs for each step.

  1. 通过检查运行历史记录来检查工作流的运行状态。Check the workflow's run status by checking the runs history. 若要查看有关某个失败运行的详细信息(包括该运行中的步骤及其状态),请选择该运行。To view more information about a failed run, including all the steps in that run in their status, select the failed run.

    查看运行历史记录并选择失败的运行

  2. 显示该运行中的所有步骤后,展开第一个失败的步骤。After all the steps in the run appear, expand the first failed step.

    展开第一个失败的步骤

  3. 检查失败步骤的输入,确认它们是否按预期方式显示。Check the failed step's inputs to confirm whether they appear as you expect.

  4. 查看某个特定运行中每个步骤的详细信息。Review the details for each step in a specific run. 在“运行历史记录”下,选择要检查的运行 。Under Runs history, select the run that you want to examine.

    查看运行历史记录

    查看逻辑应用运行的详细信息

  5. 若要检查输入、输出和特定步骤的任何错误消息,请选择该步骤,以便展开该形状并显示详细信息。To examine the inputs, outputs, and any error messages for a specific step, choose that step so that the shape expands and shows the details. 例如:For example:

    查看步骤详细信息

执行运行时调试Perform runtime debugging

若要帮助进行调试,可向逻辑应用工作流添加诊断步骤,同时查看触发器和运行历史记录。To help with debugging, you can add diagnostic steps to a logic app workflow, along with reviewing the trigger and runs history. 例如,可以添加使用 Webhook Tester 服务的步骤,以便可检查 HTTP 请求并确定其确切大小、形状和格式。For example, you can add steps that use the Webhook Tester service so that you can inspect HTTP requests and determine their exact size, shape, and format.

  1. 转到 Webhook Tester 站点,复制生成的唯一 URL。Go to the Webhook Tester site and copy the generated unique URL.

  2. 在逻辑应用中,添加一个 HTTP POST 操作以及想要测试的正文内容,例如,某个表达式或另一个步骤的输出。In your logic app, add an HTTP POST action plus the body content that you want to test, for example, an expression or another step output.

  3. 将 Webhook Tester 中的 URL 粘贴到该 HTTP POST 操作中。Paste your URL from Webhook Tester into the HTTP POST action.

  4. 若要查看在从逻辑应用引擎生成请求时如何构建该请求,请运行逻辑应用,然后重新访问 Webhook Tester 站点了解更多详细信息。To review how a request is formed when generated from the Logic Apps engine, run the logic app, and revisit the Webhook Tester site for more details.

后续步骤Next steps