Step 4: Automate Incident Response
Connect your incident platform and configure how your agent investigates matching alerts.
What you'll accomplish
- Connect Azure Monitor as your incident platform
- Create a response plan with severity filters and autonomy settings
- See how the agent investigates a matching alert and reports its findings
Prerequisites
| Requirement | Details |
|---|---|
| Completed Steps 1–3 | Create agent, Team onboarding, First investigation |
| For the end-to-end example | A connected code repository and logging provider, a non-production Azure Monitor test alert, and permission to approve proposed actions |
Connect Azure Monitor
- In the left sidebar, go to Incidents → Triggers + response plans.
- If no incident platform is connected, click Connect an incident platform.
- In Choose platform, select Azure Monitor.
- In Connect to platform, complete the required fields, then click Save to connect Azure Monitor.
Wait for the connection to complete. The status changes to "Azure Monitor connected. Your next step is to set up incident response plans."
Checkpoint: The incident platform page shows a green checkmark with "Azure Monitor connected."
You can also connect PagerDuty or ServiceNow from the platform picker.
Create an incident response plan
An incident response plan tells the agent which incidents to pick up and how much autonomy it has. The steps below are for Azure Monitor — PagerDuty and ServiceNow response plans use different filter fields based on their own incident metadata (priority, category, assignment group, etc.).
- Go to Incidents → Triggers + response plans.
- Open the creation dialog:
- If no response plans exist, click Add an incident response plan.
- If a response plan already exists, click Create a response plan.
- In Step 1: Response plan, configure the response plan details:
- In Incident response plan name, enter a descriptive name, such as
test-alerts-review. - In Severity, select the severity used by your non-production test alert.
- In Title contains, enter text that appears in the test alert title.
- In Title does not contain, add any title keywords that the plan should exclude.
- In Incident response plan name, enter a descriptive name, such as
- In the same step, configure how the agent responds:
- In Response subagent, select the agent that should investigate matching alerts.
- Under Agent autonomy level, select Review so proposed actions require approval. Autonomous is the default.
- Optionally enable Alert reinvestigation cooldown and set the cooldown time to avoid reinvestigating the same alert repeatedly within that period.
- Click Next.
- In Step 2: Incidents preview:
- Select a lookback period, such as Last 7 days.
- Review the matching alerts. If an expected alert is missing, click Back and adjust the filters.
- An empty list means no alerts matched the current filters and lookback period.
- Click Create.
Checkpoint: Your response plan appears in the list with status On and mode Review.
What happens when an alert fires
When Azure Monitor fires an alert that matches your response plan, the agent investigates automatically. What the agent does depends on the context you've given it — runbooks, code repositories, Azure resources, and prior investigations all shape the depth and actions of the investigation.
Example: HTTP 500 errors on a container app
In this example, the agent has a runbook for handling HTTP 500 errors, a connected code repository, and Azure resource access.
The agent builds a plan from your runbook. Rather than following a generic troubleshooting sequence, the agent reads the HTTP 500 runbook uploaded during onboarding and follows your team's procedures — checking upstream dependencies first, then connection pool, then recent deployments.
It recalls prior knowledge. If the agent investigated a similar issue before, it recognizes the pattern and skips discovery — combining your runbook procedures with what it learned from previous investigations.
It proposes or takes action according to the selected mode. In Review mode, the agent asks for approval before an action. In Autonomous mode, it can act within its configured permissions.
It delivers an investigation summary. The report explains what the agent found, the evidence it used, and the next action for your team.
Your results will vary based on the context your agent has. An agent with more runbooks, connected repositories, and prior investigations will produce deeper, more targeted responses.
Related capabilities
| Capability | What it adds |
|---|---|
| Incident Response Plans | Configure severity filters and custom response instructions |
| PagerDuty Incidents | Ingest and investigate PagerDuty incidents |
| Memory | How prior investigations improve future ones |
| Monitor Agent Usage | Track ongoing incidents and agent activity |