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
@@ -4,15 +4,21 @@ description: Learn how to use Azure SRE Agent and Azure App Service to identify
4
4
author: msangapu-msft
5
5
ms.author: msangapu
6
6
ms.topic: tutorial
7
-
ms.date: 05/15/2025
7
+
ms.date: 05/18/2025
8
8
---
9
9
10
10
# Troubleshoot an App Service app using Azure SRE Agent (preview)
11
11
12
12
> [!NOTE]
13
-
> Site Reliability Engineering (SRE) Agent is in preview.
13
+
> Site Reliability Engineering (SRE) Agent is in preview. By using SRE Agent you consent the product-specific terms on this page: [Preview Terms Of Use | Microsoft Azure](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
14
14
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 Azure SRE Agent. By using SRE Agent you consent the product-specific terms on this page: [Preview Terms Of Use | Microsoft Azure](https://azure.microsoft.com/support/legal/preview-supplemental-terms/)
15
+
## Introduction
16
+
17
+
The Azure SRE (Site Reliability Engineering) Agent uses AI to monitor and manage your Azure resources, helping you quickly diagnose and fix issues.
18
+
19
+
This sample app demonstrates error detection by simulating HTTP 500 failures in a controlled way. You can safely test these scenarios using Azure App Service **deployment slots**, which let you run different app configurations side by side.
20
+
21
+
You enable error simulation by setting the `INJECT_ERROR` app setting to `1`. When enabled, the app throws an HTTP 500 error after several button clicks, allowing you to see how the SRE Agent responds to application failures.
16
22
17
23
In this tutorial, you will:
18
24
@@ -31,7 +37,7 @@ In this tutorial, you will:
31
37
32
38
To complete this tutorial, you need:
33
39
- An [Azure subscription](https://azure.microsoft.com/free/).
34
-
-To create the Azure SRE Agent, your account needs Microsoft.Authorization/roleAssignments/write permissions using either Role Based Access Control Administrator or User Access Administrator.
40
+
-Permissions to create role assignments (Role Based Access Control Administrator or User Access Administrator) for SRE Agent setup.
35
41
36
42
## 1. Create an App Service app
37
43
@@ -58,25 +64,15 @@ In the *Basics* tab, provide the following details:
1. Under *Authentication settings*, enable **Basic authentication**.
68
-
69
-
> [!NOTE]
70
-
> Basic authentication 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.
71
-
72
-
1. Select **Review and create**.
73
-
74
-
- If validation passes, the **Create** button becomes active.
75
-
- If there are errors, tabs with issues are marked with a red dot. Fix the highlighted fields and try again.
76
-
77
-
1. Select **Create** to deploy the app.
78
-
79
-
Once deployment completes, you see the message: *Your deployment is complete*.
73
+
1. Under *Authentication settings*, enable **Basic authentication**. Basic authentication is used later for a one-time deployment from GitHub. [Disable Basic Auth](configure-basic-auth-disable.md?tabs=portal) in production.
74
+
1. Select **Review and create**, then **Create** when validation passes.
75
+
1. Once deployment completes, you see *Your deployment is complete*.
80
76
81
77
## 2. Deploy the sample app
82
78
@@ -92,95 +88,73 @@ Now that your App Service app is created, deploy the sample application from Git
1. Select **Save** to apply the deployment settings.
98
94
99
-
## 3. Configure the app
100
-
101
-
Next, configure your app with a startup command and enable logging to support diagnostics with the SRE Agent.
102
-
103
-
### Set the startup command
104
-
105
-
The sample app uses NGINX. The default NGINX configuration expects a `50x.html` file in the `/html` directory. The following startup command copies this file from the `wwwroot` directory to the expected location.
106
-
107
-
1. In the left menu, browse to the *Settings* section and select **Configuration**.
108
-
109
-
1. Under the *General settings* tab, locate the **Startup Command** field.
110
-
111
-
1. Enter the following command:
112
-
113
-
```bash
114
-
/home/site/wwwroot/startup.sh
115
-
```
116
-
117
-
1. Select **Save** to apply the changes.
118
-
119
-
### Enable App Service logs
120
-
121
-
Enable logging so the SRE Agent can collect diagnostic data from your app.
122
-
123
-
1. In the left menu, browse to the *Monitoring* section and select**App Service logs**.
|**Refresh / Throw Exception**| Increments the counter. If error simulation (`INJECT_ERROR` app setting) is enabled, throws an error after a set number of clicks. |
106
+
|**Reset Counter**| Resets the counter to zero. |
145
107
146
-
1. Select the first three images and select**Convert**. The conversion should complete successfully.
108
+
1.Click the main button several times to observe the counter increase, and verify error behavior if enabled.
147
109
148
-

149
110
150
-
## 5. Create a deployment slot
111
+
## 4. Set up a deployment slot for failure simulation
151
112
152
-
To simulate a failure scenario, create a secondary deployment slot.
113
+
To simulate an app failure scenario, add a secondary deployment slot.
153
114
154
115
1. In the left menu of your App Service, under the *Deployment* section, select **Deployment slots**.
0 commit comments