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
+28-31Lines changed: 28 additions & 31 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 an app using Azure SRE Agent (preview) in 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
@@ -9,11 +9,10 @@ ms.date: 05/15/2025
9
9
10
10
# Troubleshoot an App Service app using SRE Agent (preview)
11
11
12
-
> ![NOTE]
12
+
> [!NOTE]
13
13
> Site Reliability Engineering (SRE) Agent is in preview.
14
-
>
15
14
16
-
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. The sample app includes code meant to exhaust memory and cause HTTP 500 errors, so you can diagnose and fix the problem using SRE Agent.
15
+
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 aid in building resilient, self-healing systems on your behalf. The sample app includes code meant to exhaust memory and cause HTTP 500 errors, so you can diagnose and fix the problem using SRE Agent.
17
16
18
17
In this tutorial, you:
19
18
@@ -22,7 +21,7 @@ In this tutorial, you:
22
21
> * Deploy a sample App Service app using the Azure portal
23
22
> * Enable App Service logs
24
23
> * Create an Azure SRE Agent (preview) to monitor the app
25
-
> *Cause the app to produce a HTTP 500 error
24
+
> *Trigger an HTTP 500 error in the app
26
25
> * Use AI-driven prompts to troubleshoot and fix errors
To complete this tutorial, you need an [Azure subscription](https://azure.microsoft.com/free/).
33
32
34
-
## 1. Create an App Service app
33
+
## Create an App Service app
35
34
36
35
Begin by creating an app for your agent to monitor.
37
36
@@ -56,18 +55,18 @@ In the *Basics* tab, do the following actions.
56
55
57
56
| Setting | Action |
58
57
|---|---|
59
-
| Name app name |Enter **my-sre-app**. |
60
-
| Publish |Select **Code**. |
61
-
| Runtime stack| Select **PHP 8.4**. |
58
+
| Name app name | Enter **my-sre-app**. |
59
+
| Publish | Select **Code**. |
60
+
| Runtime stack| Select **PHP 8.4**. |
62
61
| Region | Select a region near you. |
63
62
64
63
1. Select the **Deployment** tab.
65
64
66
65
1. Enable **Basic authentication** in the *Authentication settings* section. This is used later for a one-time deployment from GitHub. In production, [disable Basic Auth](configure-basic-auth-disable.md?tabs=portal) and use secure deployment methods like GitHub Actions or Azure DevOps.
67
66
68
-
1. Select **Review and create** at the bottom of the page.
67
+
1. Select **Review and create** at the bottom of the page.
69
68
70
-
If no errors are found, the *Create* button is enabled.
69
+
If no errors are found, the *Create* button is enabled.
71
70
72
71
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.
73
72
@@ -85,13 +84,13 @@ In the *Basics* tab, do the following actions.
85
84
86
85
| Property | Value | Remarks |
87
86
|---|---|---|
88
-
| Source | Select **External Git**. ||
89
-
| Repository | Enter **https://github.com/Azure-Samples/App-Service-Agent-Tutorial**.||
90
-
| Branch | Select **working**. ||
87
+
| Source | Select **External Git**. ||
88
+
| Repository | Enter **https://github.com/Azure-Samples/App-Service-Agent-Tutorial**.||
89
+
| Branch | Select **working**. ||
91
90
92
91
1. Select **Save**.
93
92
94
-
## 2. Configure the app
93
+
## Configure the app
95
94
96
95
These steps configure the sample app with a *Startup command* and enable App Service logs.
97
96
@@ -124,7 +123,7 @@ This step configures application logs required by the SRE Agent to diagnose and
124
123
125
124
1. Select **Save**.
126
125
127
-
## 3. Verify the sample app
126
+
## Verify the sample app
128
127
129
128
1. Select **Overview**in the left menu.
130
129
@@ -138,7 +137,7 @@ This step configures application logs required by the SRE Agent to diagnose and
138
137
139
138

140
139
141
-
## 4. Create a deployment slot
140
+
## Create a deployment slot
142
141
143
142
1. In the left menu, find the *Deployment* section and select**Deployment slots**.
144
143
@@ -169,7 +168,7 @@ This step configures application logs required by the SRE Agent to diagnose and
169
168
170
169
1. Select **Save**.
171
170
172
-
## 5. Create an SRE agent
171
+
## Create an SRE agent
173
172
174
173
Next, create an agent to monitor the *my-aca-app-group* resource group.
175
174
@@ -197,7 +196,7 @@ Next, create an agent to monitor the *my-aca-app-group* resource group.
197
196
198
197
1. Select **Create**.
199
198
200
-
## 6. Chat with your agent
199
+
## Chat with your agent
201
200
202
201
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.
203
202
@@ -217,7 +216,7 @@ Your agent has access to any resource inside the resource groups associated with
217
216
218
217
Now that you have an agent that sees your App Service app, you can create an opportunity for the agent to make a fix on your behalf.
219
218
220
-
## 7. Break the app
219
+
## Break the app
221
220
222
221
1. In your App Service app page, find **Deployment* section in the left menu and select**Deployment slots**.
223
222
@@ -244,7 +243,7 @@ Now that you have an agent that sees your App Service app, you can create an opp
244
243
245
244
1. Repeat the convert step several more times to log more HTTP 500s.
246
245
247
-
## 7. Fix the app
246
+
## Fix the app
248
247
249
248
1. Go to the Azure portal, search for and select**Azure SRE Agent**.
250
249
@@ -262,33 +261,31 @@ Now that you have an agent that sees your App Service app, you can create an opp
262
261
263
262
While every chat session is different, you should see a response that resembles the following response.
264
263
265
-
>I will now perform mitigation for my-sre-app by swapping the slots back to recover the application to a healthy state. Please note that swapping slots back may not always immediately restore health. I will keep you updated on the progress.
266
-
>
264
+
> I will now perform mitigation for my-sre-app by swapping the slots back to recover the application to a healthy state. Please note that swapping slots back may not always immediately restore health. I will keep you updated on the progress.
267
265
268
266
Given that enough time has passed for the SRE Agent to detect the errors, it will prompt you with the following message:
269
267
270
-
>Performing Slot Swap rollback to Restore Application Avaialibilty for my-sre-app
271
-
>[Approve] [Deny]
272
-
268
+
> Performing Slot Swap rollback to Restore Application Availability for my-sre-app
269
+
> [Approve] [Deny]
273
270
274
271
1. Select the **Approve** button to rollback the swap.
275
272
276
-
As your agent processes this command. After the swap, the agent's response will include with something that resembles the following message:
273
+
As your agent processes this command. After the swap, the agent's response will include something that resembles the following message:
277
274
278
275
> The slot swap for my-sre-app has been completed successfully <timestamp>. The production slot has been restored. I will now continue with post-mitigation steps:
279
-
>>I will ask you for the correct GitHub repo URL to raise an issue for the swap-related downtime.
280
-
>>I will monitor the app and provide an availability update in 5 minutes.
276
+
>>I will ask you for the correct GitHub repo URL to raise an issue for the swap-related downtime.
277
+
>>I will monitor the app and provide an availability update in 5 minutes.
281
278
> Please provide the GitHub repository URL where you want the issue to be raised.
282
279
283
-
## 8. Verify the fix
280
+
## Verify the fix
284
281
285
282
1. To verify your App Service app is working properly, open the app's URL in a browser.
286
283
287
284
1. To convert images, click `Tools` and select `Convert to PNG`.
288
285
289
286

290
287
291
-
1. Select the first 5 images and click `convert`. Converting images should not longer produce the HTTP 500 errors.
288
+
1. Select the first 5 images and click `convert`. Converting images should no longer produce HTTP 500 errors.
292
289
293
290

0 commit comments