Set up alerts in Azure Container Apps
Azure Monitor alerts notify you so that you can respond quickly to critical issues. There are two types of alerts that you can define:
- Metric alerts based on Azure Monitor metric data
- Log alerts based on Azure Monitor Log Analytics data
You can create alert rules from metric charts in the metric explorer and from queries in Log Analytics. You can also define and manage alerts from the Monitor>Alerts page. To learn more about alerts, refer to Overview of alerts in Microsoft Azure.
The Alerts page in the Monitoring section on your container app page displays all of your app's alerts. You can filter the list by alert type, resource, time and severity. You can also modify and create new alert rules from this page.
Create metric alert rules
When you create alerts rules based on a metric chart in the metrics explorer, alerts are triggered when the metric data matches alert rule conditions. For more information about creating metrics charts, see Using metrics explorer
After creating a metric chart, you can create a new alert rule.
- Select New alert rule. The Create an alert rule page is opened to the Condition tab. Here you'll find a condition that is populated with the metric chart settings.
- Select the condition.
- Modify the Alert logic section to set the alert criteria. You can set the alert to trigger when the metric value is greater than, less than, or equal to a threshold value. You can also set the alert to trigger when the metric value is outside of a range of values.
- Select Done.
- You can add more conditions to the alert rule by selecting Add condition on the Create an alert rule page.
- Select the Details tab.
- Enter a name and description for the alert rule.
- Select Review + create.
- Select Create.
Add conditions to an alert rule
To add more conditions to your alert rule:
- Select Alerts from the left side menu of your container app page.
- Select Alert rules from the top menu.
- Select an alert from the table.
- Select Add condition in the Condition section.
- Select from the metrics listed in the Select a signal pane.
- Configure the settings for your alert condition. For more information about configuring alerts, see Manage metric alerts.
You can receive individual alerts for specific revisions or replicas by enabling alert splitting and selecting Revision or Replica from the Dimension name list.
Example of selecting a dimension to split an alert.
To learn more about configuring alerts, visit Create a metric alert for an Azure resource
Create log alert rules
You can create log alerts from queries in Log Analytics. When you create an alert rule from a query, the query is run at set intervals triggering alerts when the log data matches the alert rule conditions. To learn more about creating log alert rules, see Manage log alerts.
To create an alert rule:
- First, create and run a query to validate the query.
- Select New alert rule.
- The Create an alert rule editor is opened to the Condition tab, which is populated with your log query.
- Configure the settings in the Measurement section
- Optionally, you can enable alert splitting in the alert rule to send individual alerts for each dimension you select in the Split by dimensions section of the editor.
- Enter the threshold criteria in theAlert logic section.
- Select the Details tab.
- Enter a name and description for the alert rule.
- Select Review + create.
- Select Create.