An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
The Microsoft-supported, cost-effective setup is:
- Create an Azure Monitor alert rule on the Application Insights resource for production exceptions or failed requests.
- Create an Action Group that triggers a Logic App.
- In the Logic App, use the Microsoft Teams action Post message in a chat or channel to send the alert details to the target Teams destination.
- Avoid classic Teams incoming connectors for new implementations. Microsoft 365 connectors are nearing deprecation, and Teams guidance points to Workflows/Power Automate-based webhook workflows instead.
Recommended configuration path:
- In Azure portal, open the Application Insights resource for the production app.
- Go to Alerts in the left navigation and select Create an alert rule.
- Choose the signal that matches the failure type being monitored:
- Failed requests for request/run failures.
- Dependency call failures if the issue is tied to dependency/action/trigger failures.
- Set the threshold and evaluation frequency for the alert.
- Create or select an Action Group.
- In the action group, configure it to trigger the Logic App.
- In the Logic App designer, add the Teams action:
- Search for Post message in a chat or channel.
- Under Microsoft Teams, select Post message in a chat or channel.
- Sign in to Teams when prompted.
- Set Post as to User.
- Set Post in to the required destination supported by the action.
- Select the target chat/channel.
- Build the Teams message by combining static text with alert payload fields from Dynamic content. The documented examples include fields such as:
- alertRule
- severity
- firedDateTime
- Save the Logic App.
- Finish the alert rule by setting name and severity, then review and create it.
For the message body, include the exception summary and alert metadata from the payload. A practical Teams message format is:
- Alert name
- Severity
- Fired time
- Exception type/message if present in the payload
- A pointer back to Application Insights for investigation
If richer exception details are required beyond the standard alert payload, use the Logic App to process the alert payload and format the Teams post accordingly.
Why this is the recommended approach:
- Azure Monitor supports alert rules with Action Groups.
- Logic Apps are documented for customizing alert notifications.
- Teams posting is supported through the Post message in a chat or channel action.
- Teams guidance indicates moving away from classic connector-based webhooks toward Workflows/Power Automate patterns.
Cost-effective choice:
- Use Azure Monitor alerts + Action Group + Logic App only for production error conditions instead of continuously polling telemetry.
- Trigger notifications only when the alert fires, which is generally more cost-efficient than scheduled query workflows that run every few minutes.