You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-sre-agent.md
+97-60Lines changed: 97 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'Tutorial: Troubleshoot with SRE Agent on Azure App Service'
2
+
title: 'Tutorial: Troubleshoot an app using Azure SRE Agent (preview) in Azure App Service'
3
3
description: Learn how to use SRE Agent and Azure App Service to identify and fix app issues with AI-assisted troubleshooting.
4
4
author: msangapu-msft
5
5
ms.author: msangapu
@@ -10,106 +10,143 @@ ms.date: 04/22/2025
10
10
11
11
# Tutorial: Troubleshoot an App Service app using SRE Agent
12
12
13
-
This tutorial shows how to deploy a broken web app to Azure App Service, create an Agent Space, and use its AI-assisted capabilities to troubleshoot and fix application issues. You'll use the Azure Developer CLI (azd) to provision and deploy resources, simulate a bug, and use Agent Space to diagnose and resolve the error.
13
+
The Azure SRE (Site Reliability Engineering) Agent helps you manage and monitor Azure resources by using AI-enabled capabilities. Agents guide you in solving problems and aids in build resilient, self-healing systems on your behalf.
14
+
15
+
In this tutorial, you:
14
16
15
17
> [!div class="checklist"]
16
-
> * Deploy a sample broken app using azd
17
-
> * Set up Agent Space and link the resource group
18
+
> * Deploy a sample container app using the Azure portal
19
+
> * Create an Azure SRE Agent to monitor the app
20
+
> * Intentionally misconfigure the container app
18
21
> * Use AI-driven prompts to troubleshoot and fix errors
To complete this tutorial, you need an [Azure subscription](https://azure.microsoft.com/free/).
28
+
29
+
## 1. Create an App Service app
30
+
31
+
Begin by creating an app for your agent to monitor.
32
+
33
+
1. Go to the [Azure portal](https://portal.azure.com) and search for **App Services** in the top search bar.
34
+
35
+
1. Select **App Services** in the search results.
36
+
37
+
1. Select the **Create** button and select **Web App**.
38
+
39
+
### Basics tab
40
+
41
+
In the *Basics* tab, do the following actions.
42
+
43
+
1. Enter the following values in the *Project details* section.
44
+
45
+
| Setting | Action |
46
+
|---|---|
47
+
| Subscription | Select your Azure subscription. |
48
+
| Resource group | Select **Create new** and enter **my-app-service-group**. |
49
+
50
+
1. Enter the following values in the *Instance details* section.
51
+
52
+
| Name app name | Enter **my-sre-app**. |
53
+
| Publish | Select **Code**. |
54
+
| Runtime stack| Select **PHP 8.4**. |
55
+
| Region | Select a region near you. |
56
+
57
+
1. Select the **Deployment** tab.
58
+
59
+
1. Enable **Basic authentication** in the *Authentication settings* section.
60
+
61
+
1. Select **Review and create** at the bottom of the page.
62
+
63
+
If no errors are found, the *Create* button is enabled.
64
+
65
+
If there are errors, any tab containing errors is marked with a red dot. Navigate to the appropriate tab. Fields containing an error are highlighted in red. Once all errors are fixed, select **Review and create** again.
66
+
67
+
1. Select **Create**.
68
+
69
+
A page with the message *Deployment is in progress* is displayed. Once the deployment is successfully completed, you see the message: *Your deployment is complete*.
70
+
71
+
### Deploy the sample app
72
+
73
+
1. To view your new App Service, select **Go to resource**.
3. Remove a key like `APP_MODE` or alter it to trigger a runtime error
76
-
4. Save and restart the app
113
+
| Property | Value | Remarks |
114
+
|---|---|---|
115
+
| Subscription | Select your Azure subscription. ||
116
+
| Resource group | Enter **my-sre-agent-group**. ||
117
+
| Name | Enter **my-app-svc-sre-agent**. ||
118
+
| Region | Select **Sweden Central**. | During preview, SRE Agents are only available in the *Sweden Central* region, but they can monitor resources in any Azure region. |
77
119
78
-
### Use Agent Space to identify and fix the issue
120
+
1. Select the **Select resource groups** button.
79
121
80
-
Open your Agent Space and begin chatting:
122
+
1. In the *Select resource groups to monitor* window, search for and select the **my-aca-app-group** resource group.
81
123
82
-
#### Prompt to identify the issue:
124
+
1. Scroll to the bottom of the dialog window and select **Save**.
83
125
84
-
> "My App Service app in resource group `brokenapp-env-rg` is returning a 500 error. Can you help me figure out why?"
126
+
1. Select **Create**.
85
127
86
-
#### Prompt to confirm recent change:
128
+
##3. Chat with your agent
87
129
88
-
> "I recently removed the `APP_MODE` setting. Could this be causing the issue?"
130
+
Your agent has access to any resource inside the resource groups associated with the agent. Use the chat feature to help you inquire about and resolve issues related to your resources.
89
131
90
-
Agent Space will analyze logs, configurations, and suggest a fix.
132
+
1. Go to the Azure portal, search for and select **Azure SRE Agent**.
91
133
92
-
### Apply the fix
134
+
1. Select **my-app-svc-agent** from the list.
93
135
94
-
Restore the environment variable in App Service or make the recommended code change, then redeploy:
136
+
1. Select **Chat with agent**.
95
137
96
-
```bash
97
-
azd deploy
98
-
```
138
+
1. In the chat box, give your agent the following command.
99
139
100
-
## Verify the fix
140
+
```text
141
+
List my app service apps
142
+
```
101
143
102
-
- Browse to your app again
103
-
- Confirm the 500 error is resolved
104
-
- Repeat the steps that caused the issue to verify it's fixed
144
+
1. The agent responds with details about the container app deployed in the *my-aca-app-group* resource group.
105
145
106
-
## Clean up resources
146
+
Now that you have an agent that sees your container app, you can create an opportunity for the agent to make a repair on your behalf.
0 commit comments