Skip to content

Instantly share code, notes, and snippets.

AppTraces
| where OperationName == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(Properties.prop__properties)).resource))
| project TimeGenerated
, LogicApp = tostring(AppRoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(resource.runId)
, ClientTrackingId = tostring(Properties.prop__clientTrackingId)
, WorkflowStatus = tostring(Properties.prop__status)
| sort by TimeGenerated desc
traces
| where customDimensions.EventName == "WorkflowTriggerEnd"
| where customDimensions.prop__status == "Failed"
| sort by timestamp desc
| extend properties = parse_json(tostring(customDimensions.prop__properties))
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| extend error = parse_json(tostring(customDimensions.prop__error))
| sort by timestamp desc
| project timestamp
, LogicApp = tostring(cloud_RoleName)
traces
| where customDimensions.EventName == "WorkflowTriggerEnd"
| where customDimensions.prop__status == "Failed"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
| summarize Count = count()
by bin(timestamp, 1d),
Workflow
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowStatus = tostring(customDimensions.prop__status)
| where WorkflowStatus == "Failed"
| summarize Count = count()
by bin(timestamp, 1d)
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| extend error = parse_json(tostring(customDimensions.prop__error))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
// Logic App instances with workflow final status, workflow run id, client tracking id, and tracked properties.
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
// Logic App instances with workflow run id, client tracking id, and workflow final status.
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each_message_in_batch": {
"actions": {
"Parse_message": {
"description": "Parse each individual record",
"inputs": {
"content": "@items('For_each_message_in_batch')",
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowStatus = tostring(customDimensions.prop__status)
| where WorkflowStatus == "Failed"
| summarize Count = count()
by bin(timestamp, 1d)
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| extend error = parse_json(tostring(customDimensions.prop__error))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status