Max: Hey Zoe, I need to set up alerts for cloud flow run failures in Power Automate and also want to debug logs in detail. Can you guide me through the process?
Zoe: Absolutely, Max! Setting up alerts and debugging logs in Application Insights can help you monitor and quickly respond to issues with your Power Automate flows. Let’s start with setting up alerts for cloud flow run failures.
Max: Great! How do I create alerts for cloud flow run failures?
Zoe: Follow these steps:
- Access Alerts: From the Application Insights dashboard for your instance, select Alerts from the left navigation and then select Create an alert rule.
- Select Signal:
- For cloud flow triggers and actions, select Dependency calls. To alert on failures, choose Dependency call failures.
- For cloud flow runs, select Server Requests. To alert only on run failures, select Failed requests.
- Set Thresholds: Define the threshold for monitoring errors and set the frequency for checking errors.
- Add Conditions: You can combine multiple conditions into a single alert by selecting Add condition and repeating the previous steps.
- Create Action Group: If an action group isn’t already created, set up a specific action group. More information can be found in the Action groups documentation.
- Configure Notifications: Enter the notification type and the action to be performed once the alert is fired. You can use a webhook to trigger a Power Automate flow for advanced notifications through Microsoft Teams or other communication channels.
- Finalize Alert: Review the settings, configure the severity of the alert, provide a name, and finish setting up the alert.
Max: What if I need to create custom alerts for specific environments or flows?
Zoe: For custom alerts, you can use Custom log search. Here’s how:
- Add Custom Log Search: While creating an alert rule, add a condition with the signal name Custom log search.
- Enter Custom Query: Here are some sample queries:
- Filtering for a specific cloud flow’s failures:
let myEnvironmentId = 'Insert your environment ID here';
let myFlowId = 'Insert your flow ID here';
requests
| where timestamp > ago(1d)
| where customDimensions['resourceProvider'] == 'Cloud Flow'
| where customDimensions['signalCategory'] == 'Cloud flow runs'
| where customDimensions['environmentId'] == myEnvironmentId
| where customDimensions['resourceId'] == myFlowId
| where success == false - Filtering for a specific cloud trigger’s failures:
let myEnvironmentId = 'Insert your environment ID here';
let myFlowId = 'Insert your flow ID here';
dependencies
| where timestamp > ago(1d)
| where customDimensions['resourceProvider'] == 'Cloud Flow'
| where customDimensions['signalCategory'] == 'Cloud flow triggers'
| where customDimensions['environmentId'] == myEnvironmentId
| where name == 'Insert your trigger name'
| where success == false - Filtering for a specific cloud action’s failures:
let myEnvironmentId = 'Insert your environment ID here';
let myActionName = 'Insert your action name';
dependencies
| where timestamp > ago(1d)
| where customDimensions['resourceProvider'] == 'Cloud Flow'
| where customDimensions['signalCategory'] == 'Cloud flow actions'
| where customDimensions['environmentId'] == myEnvironmentId
| where name == myActionName
| where success == false
- Filtering for a specific cloud flow’s failures:
Max: What about debugging the logs in detail?
Zoe: You can use Log Analytics in Application Insights to perform custom debugging:
- Cloud Flow Runs: Data is available in the Requests table.
- Cloud Flow Triggers and Actions: Data is available in the Dependencies table.
- Custom Dimensions: This column contains metadata like environment ID, flow ID, and action names for detailed debugging.
Use the following example query to debug cloud flow runs:
requests
| where customDimensions['resourceProvider'] == 'Cloud Flow'
| where customDimensions['signalCategory'] == 'Cloud flow runs'
| project timestamp, customDimensions['environmentId'], customDimensions['resourceId'], success, resultCode
Max: Thanks, Zoe! This really helps me set up alerts and debug my Power Automate flows effectively.
Zoe: Anytime, Max! Setting up these alerts and utilizing log analytics will ensure you can monitor and troubleshoot your automation efficiently. If you have any more questions, feel free to ask!
