Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If something happens in your environment or app that you need to act on, you can set up a system that sends you an alert. Azure Application Insights makes it easy to define such alerts.
You can use the following tools to define and set up alerts on telemetry events:
- Azure Application Insights Alerts
- Azure Logic Apps
- Power Automate
If you use the Power BI app on telemetry data, you can also use Power BI goals to track measures against business objectives.
For telemetry alerts, you need a Kusto (KQL) query to define the alerting condition.
Track telemetry with Power BI goals
If you use the Power BI app on telemetry data, you can track the goals that are important to you.
With goals in Power BI, you can curate your own goals and track them against key business objectives, in a single pane. This feature enhances data culture by promoting accountability, alignment, and visibility for teams and initiatives within organizations.
Follow this four-step process to set up goals in Power BI:
- Create a scorecard in the Power BI service. Learn more in Create scorecards in Power BI.
- Add the goals you want to track by connecting to your Power BI report on telemetry. Learn more in Create connected goals.
- Define status rules for your goals to automate status updates based on value, percentage of target met, date conditions, or a combination. For connected goals, these status rules are refreshed every time the data in your scorecard is refreshed. Learn more in Create automated status rules for goals.
- Review the goal details and status changes in the scorecard. Learn more in Stay on top of your goals in Power BI.
For notifications based on a telemetry query, use Azure Monitor alerts, Azure Logic Apps, or Power Automate. Learn more in Alert on telemetry and Get started with goals in Power BI.
Low-code alerting with KQL
When defining an alert based directly on telemetry, you need to define two things:
- A Kusto (KQL) query that defines the alerting condition. It's considered good practice to add a
whereclause that limits the timestamp of events in the query, for example,| where timestamp > ago(1h). - How often you want to run the alerting query. Choose the frequency based on how quickly you need to respond and account for ingestion delay. The frequency can be shorter than the query's lookback period.
Tip
Samples of alerting queries are shared by Microsoft and third parties on the Business Central BCTech repository on GitHub. You can also share your alerting queries with the community on GitHub.
Create alerts in Azure Application Insights
If you want to create alerts in Azure Application Insights, then do as follows:
- Open the Azure portal and locate your Application Insights resource.
- In the navigation pane on the left, select Alerts, and then select Create > Alert rule.
- On the Condition tab, select Custom log search, and then enter your KQL alerting query.
- Configure the threshold and evaluation frequency, select or create an action group for notifications, and create the alert rule.
Learn more in Create Azure Monitor log search alert rules.
Create alerts using Azure Logic Apps and Power Automate
Azure Logic Apps and Power Automate can use the Azure Monitor Logs connector to query telemetry for custom notifications or actions triggered by an environment's lifecycle event. When querying the linked Log Analytics workspace, use workspace table and column names, such as AppTraces, TimeGenerated, and Properties, instead of traces, timestamp, and customDimensions. Learn more in Azure Monitor Logs connector.
Note
Samples of custom notifications and automations are shared by Microsoft and third parties on the Business Central BCTech repository on GitHub. You can also share your Application Insights Alerts and Automations with the community on GitHub.
The samples below can help you get started with customization and automation using Application Insights.
Important
These sample templates use the deprecated Azure Application Insights connector and API-key authentication. For new workflows, use the Azure Monitor Logs connector with Microsoft Entra authentication. Adapt the sample queries, connection resources, and result handling before using them with the new connector.
Deploying a Logic App also creates the API connection resources needed by its actions. After deployment, open those resources in the Azure portal to authenticate them.
If the required API connection resources already exist in the selected resource group, you can reuse them by entering the same resource name before deployment.
Example - Run an alerting query every "n" days and send an email
This Logic App runs at an interval in days specified during deployment. It lists updates automatically scheduled for environments that emit telemetry to the specified Application Insights resource during that period. It filters on event LC0101 and excludes schedules selected by a partner. Administrators can use this app to supplement update notifications.
Deploy the available update notification template to Azure.
Example - Run an alerting query every "n" minutes and send a message to Teams
This Logic App queries Application Insights every number of minutes (specified in app deployment). It notifies a user (also specified in deployment) of any deleted environments in Microsoft Teams. The action that sends the notification in Teams can be updated to notify a Channel or Group Chat instead.
Deploy the deleted environment notification template to Azure.
Related information
Telemetry overview
Enabling telemetry
Available telemetry
Telemetry FAQ