Azure 逻辑应用 : How to be notified if a logic app action connection breaks or fails

标签 azure azure-logic-apps kql azure-diagnostics

我想构建一个逻辑应用,当我的环境中的任何逻辑应用失败或连接断开时,它会告诉我。 (逻辑应用的手动触发和自动触发)

我发现最接近实现此目的的 KQL 是:

SentinelHealth 
| where TimeGenerated > ago(7d)
| where SentinelResourceType == "Automation rule"
| mv-expand TriggeredPlaybooks = ExtendedProperties.TriggeredPlaybooks
| extend runId = tostring(TriggeredPlaybooks.RunId)
| join (AzureDiagnostics 
    | where OperationName == "Microsoft.Logic/workflows/workflowRunCompleted"
    | extend IncidentNumber = toint(extract(@"[a-f0-9]{8}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{12}\_(\d+)", 1, correlation_clientTrackingId_s))
    | project
        IncidentNumber,
        resource_runId_s,
        playbookName = resource_workflowName_s,
        playbookRunStatus = status_s)
    on $left.runId == $right.resource_runId_s
| project
    RecordId,
    TimeGenerated,
    AutomationRuleName= SentinelResourceName,
    AutomationRuleStatus = Status,
    Description,
    workflowRunId = runId,
    playbookName,
    playbookRunStatus,
    IncidentNumber

KQL source

这是我现在的工作流程: enter image description here 查询运行并输出到一个 html 表,该表通过电子邮件发送给我。

问题是我知道我的环境中有多个逻辑应用存在失败操作断开连接操作,这些操作未被我的逻辑应用 + kql 捕获.

当逻辑应用失败时(完全失败和特定操作失败时),您将如何解决检测和通知的问题

最佳答案

Azure Logic Apps: How to be notified if a logic app act connection breaks or fails

一种方法是检查如下:

enter image description here

另一种方法是在每个操作之后添加并行操作,如下所示以获取警报:

enter image description here

如果警报失败,否则如果为真,则下一步操作如下:

enter image description here

enter image description here

要使上述步骤生效,您需要添加如下代码:

runAfter 失败

enter image description here

输出:

enter image description here

因此,像这样,对于每个操作,您需要添加并行操作(我只对操作 parsejson 进行了操作,以了解如何执行操作),并且对于该操作,您需要将 runafter 更改为失败,然后您将收到警报。

另请参阅此 SO-Thread1SO-Thread2

关于Azure 逻辑应用 : How to be notified if a logic app action connection breaks or fails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77270463/

相关文章:

c# - 防止公共(public)服务过度使用

永远不会执行的Azure函数作业

c# - Azure LogicManagementClient 在初始化期间返回 "Attempted to access an element as a type incompatible with the array."错误

azure-logic-apps - Azure 逻辑应用程序 - 在新电子邮件上 - 附件有空字节

azure - 如何制作包含两行(来自两个 Kusto 查询)的 Application Insights 仪表板指标图表?

azure - 如何在 Azure 逻辑应用程序中使用 HMAC/签名 key 验证 Webhook 消息?

Windows Azure 上的 asp.net 身份验证

android - Twilio SMS 正文不会连接 Azure 逻辑应用程序中的 URL 参数

azure-data-explorer - 获取最大日期列而不使用 Kusto 中的汇总

azure - 不同排列的 KQL 连接