If you using Power Automate flows in critical business applications it is vital that you know when any errors occur. This post explains how you can use the Power Platform Admin Centre Data Export option in conjunction with Azure Application Insights to get real time alerts when flows fail. It also shows you how to query for flow failures from Power BI
Azure Application Insights is an Azure service build on top of Azure Monitor allowing you to monitor applications providing information on errors and performance. It can be used in conjunction with Azure Alerts to send real time notifications of problems in your applications. You can configure the telemetry from your flows to be exported to Azure Application Insights. This is done from the Data Export option on the Power Platform Admin Centre. The Dataverse environment has to be a Managed Environment to be configured for Application Insights.
Having selected the dataverse environment you then select the Application Insights instance it will export to. It takes up to 24 hours for the telemetry data to being appearing in your App Insights instance.
Once your Power Automate telemetry data starts flowing into to your App Insights you can start to view your data in the Application Insights dashboard.
Telemetry data in App Insights in stored in log tables and the primary log table is the request table. Each action your flow executes, including the trigger, creates a request entry. The request table supports custom properties and these are stored in a column called customDimensions as name value pairs. For Power Automate flows the customDimensions column contain values indicating it is a Flow request and which Flow it relates to.
resourceProvider | App Insights connection provider “Cloud Flow” |
signalCategory | “Cloud flow runs” |
resourceId | Flow Id |
environmentId | environmentId |
You can query your logs filtering using a language called Kusto , using the custom property signalCategory to identify flows. This is important as your Application Insights instance may be collecting telemetry data from a range of applications. You could also filter by environmentId if you multiple Dataverse environments exporting telemetry into the same Application Insights instance.
requests
| extend flowId = customDimensions["resourceId"], environmentId = customDimensions["environmentId"]
| where customDimensions.signalCategory == "Cloud flow runs"
To gets instant notifications of Flows failures you can create an Alert Rule with a custom Kusto query for failed flows. You can configure your alert to send notifications via SMS or Email.
You could also use Power BI to query your Application Insights and display this data in a report. Once you have your Kusto query created select the option to export it to Power BI as an M Query. This will download a text file containing the M query.
From Power BI select the option to get data using a blank query.
Select advanced editor and paste in the downloaded query. When you save it your will need to authenticate to connect Application Insights.
You can read some more about surfacing Application Insights in Power BI here.
My personal preference for critical workflows and system integration is to use Logic Apps. Power Automate is build on top of Logic App so its basically the same thing. Because they run on Azure you can create your alerts directly in Azure.