LowCodeStacks™
Sign in

Alerts for failed Power Automate flows in Application Insights

Send Power Automate telemetry to Application Insights, alert on failed flow runs and actions across an environment, and start from KQL queries for the failures that matter.

Azure + Power PlatformFix a problem5 min read

Checked against Microsoft Learn · 5 sourcesPosted by the Maker DeskHow we write guides

Power Automate's own run history shows one flow at a time, and its failure emails depend on someone reading them. Application Insights collects every cloud flow run, trigger and action in an environment in one place, so you can alert on failures across all your flows, send the alert to a team rather than one owner, and query the history with KQL. This guide sets up the export, the alerts, and the queries worth saving.

Before you start

  • A Managed Environment. The export only works for environments with Managed Environments turned on.
  • Admin roles. The person who sets it up needs the Power Platform administrator (or Dynamics 365 administrator) role in Microsoft Entra ID, and the environment admin or system administrator role in the environment. Missing either is the most common reason no data arrives.
  • An Application Insights resource that you have Contributor or Owner rights on, with local authentication allowed. Use one resource per environment: Microsoft's built-in reports don't work correctly when several environments send to the same one.
  • Not in sovereign clouds. The Power Automate export isn't available in GCC, GCC High, DoD or 21Vianet.

Export the telemetry

  1. In the Power Platform admin center, select Manage > Data export, then the App Insights tab, then New data export.
  2. Name the export, choose Power Automate, and pick what to send: cloud flow runs, triggers, actions, or all three.
  3. Choose the environment to export from, then the subscription, resource group and Application Insights resource to export to.
  4. Review and select Create.

Data can take up to 24 hours to start arriving. When it does, flow runs land in the requests table, and triggers and actions in the dependencies table. The details you'll filter on, such as the environment ID and the flow ID, are in each row's customDimensions.

Create the alerts

For every flow in the environment, use the built-in signals. In Application Insights, open Alerts > Create an alert rule and add a condition:

  • Failed requests fires on failed flow runs.
  • Dependency call failures fires on failed triggers and actions.

Set a threshold and how often to check, then attach an action group that emails a shared mailbox, notifies a team in Teams, or calls a webhook. A webhook can start a Power Automate flow that posts a richer message, as long as that flow doesn't report on itself.

For the flows that matter most, add a condition of type Custom log search with a query like this one, and alert when it returns any rows:

kusto
// One critical flow's failed runs. The flow ID is the part of the flow's
// address after /flows/ in Power Automate.
requests
| where customDimensions["signalCategory"] == "Cloud flow runs"
| where customDimensions["resourceId"] == "<flow-id>"
| where success == false

Queries worth saving

Run these in Logs in your Application Insights resource, and pin the useful ones to a dashboard.

Which flows failed in the last day, and when each last failed:

kusto
requests
| where timestamp > ago(1d)
| where customDimensions["resourceProvider"] == "Cloud Flow"
| where customDimensions["signalCategory"] == "Cloud flow runs"
| where success == false
| summarize failures = count(), lastFailure = max(timestamp)
    by flowId = tostring(customDimensions["resourceId"]),
       environmentId = tostring(customDimensions["environmentId"])
| order by failures desc

Which actions fail most often, across all flows:

kusto
dependencies
| where timestamp > ago(7d)
| where customDimensions["resourceProvider"] == "Cloud Flow"
| where customDimensions["signalCategory"] == "Cloud flow actions"
| where success == false
| summarize failures = count()
    by action = name, flowId = tostring(customDimensions["resourceId"])
| top 20 by failures

Flows whose trigger keeps failing, so they never start at all:

kusto
dependencies
| where timestamp > ago(1d)
| where customDimensions["signalCategory"] == "Cloud flow triggers"
| where success == false
| summarize failures = count() by trigger = name, flowId = tostring(customDimensions["resourceId"])
| order by failures desc

Whether runs are getting slower, hour by hour:

kusto
requests
| where timestamp > ago(7d)
| where customDimensions["signalCategory"] == "Cloud flow runs"
| summarize p95 = percentile(duration, 95), runs = count() by bin(timestamp, 1h)
| render timechart

What the telemetry can't promise

  • It isn't real time. Microsoft's commitment is to deliver the data within 24 hours, so an alert can arrive well after the failure. For a flow where minutes matter, also handle errors inside the flow itself.
  • It isn't complete. Microsoft notes the export can occasionally lose a little data. The run history in Power Automate is the full record; use it to confirm what an alert reports.
  • It costs Azure money. Application Insights is billed for the data it takes in and keeps. Export only the signals you'll use, and review the resource's retention and daily cap.

Sources

Did this fix it?

Comments

No comments yet. Share what worked for you.

Sign in to comment. Comments show under a display name you choose, never your email.