Skip to content

Commit 5b6fee0

Browse files
committed
fix issues
1 parent f2afe9b commit 5b6fee0

File tree

1 file changed

+60
-67
lines changed

1 file changed

+60
-67
lines changed

articles/app-service/tutorial-sre-agent.md

Lines changed: 60 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In this tutorial, you will:
3131

3232
To complete this tutorial, you need an [Azure subscription](https://azure.microsoft.com/free/).
3333

34-
## Create an App Service app
34+
## 1. Create an App Service app
3535

3636
Start by creating a web app that the SRE Agent will monitor.
3737

@@ -46,19 +46,19 @@ In the *Basics* tab, provide the following details:
4646

4747
**Project details**
4848

49-
| Setting         | Value                          |
49+
| Setting | Value |
5050
|-----------------|--------------------------------|
51-
| Subscription     | Your Azure subscription        |
52-
| Resource group   | **Create new**`my-app-service-group` |
51+
| Subscription | Your Azure subscription |
52+
| Resource group | **Create new**`my-app-service-group` |
5353

5454
**Instance details**
5555

56-
| Setting         | Value                          |
56+
| Setting | Value |
5757
|-----------------|--------------------------------|
58-
| Name            | `my-sre-app`                   |
59-
| Publish         | **Code**                       |
60-
| Runtime stack   | **PHP 8.4**                    |
61-
| Region          | A region near you              |
58+
| Name | `my-sre-app` |
59+
| Publish | **Code** |
60+
| Runtime stack | **PHP 8.4** |
61+
| Region | A region near you |
6262

6363

6464
1. Select the **Deployment** tab.
@@ -70,15 +70,14 @@ In the *Basics* tab, provide the following details:
7070
7171
1. Select **Review and create**.
7272

73-
    - If validation passes, the **Create** button becomes active.
74-
    - If there are errors, tabs with issues are marked with a red dot. Fix the highlighted fields and try again.
73+
- If validation passes, the **Create** button becomes active.
74+
- If there are errors, tabs with issues are marked with a red dot. Fix the highlighted fields and try again.
7575

7676
1. Select **Create** to deploy the app.
7777

7878
Once deployment completes, you’ll see the message: *Your deployment is complete*.
7979

80-
### Deploy the sample app
81-
80+
## 2. Deploy the sample app
8281

8382
Now that your App Service app is created, deploy the sample application from GitHub.
8483

@@ -88,16 +87,15 @@ Now that your App Service app is created, deploy the sample application from Git
8887

8988
1. In the *Settings* tab, configure the following:
9089

91-
    | Property   | Value                                                              |
92-
    |------------|--------------------------------------------------------------------|
93-
    | Source     | **External Git**                                                   |
94-
    | Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial`     | 
95-
    | Branch     | `working`                                                          |
96-
90+
| Property | Value |
91+
|------------|------------------------------------------------------------|
92+
| Source | **External Git** |
93+
| Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial` |
94+
| Branch | `working` |
9795

9896
1. Select **Save** to apply the deployment settings.
9997

100-
## Configure the app
98+
## 3. Configure the app
10199

102100
Next, configure your app with a startup command and enable logging to support diagnostics with the SRE Agent.
103101

@@ -112,9 +110,9 @@ The sample app uses NGINX. The default NGINX configuration expects a `50x.html`
112110

113111
1. Enter the following command:
114112

115-
    ```bash
116-
    /home/site/wwwroot/startup.sh
117-
    ```
113+
```bash
114+
/home/site/wwwroot/startup.sh
115+
```
118116

119117
1. Select **Save** to apply the changes.
120118

@@ -126,14 +124,14 @@ Enable logging so the SRE Agent can collect diagnostic data from your app.
126124

127125
1. Configure the following settings:
128126

129-
    | Property               | Value           | Remarks                                |
130-
    |------------------------|------------------|----------------------------------------|
131-
    | Application logging    | **File System**  | Enables log collection for diagnostics |
132-
    | Retention Period (Days)| `3`              | Retains logs for 3 days                |
127+
| Property | Value | Remarks |
128+
|------------------------|-----------------|----------------------------------------|
129+
| Application logging | **File System** | Enables log collection for diagnostics |
130+
| Retention Period (Days)| `3` | Retains logs for 3 days |
133131

134132
1. Select **Save** to apply the logging configuration.
135133

136-
## Verify the sample app
134+
## 4. Verify the sample app
137135

138136
After deployment and configuration, verify that the sample app is running correctly.
139137

@@ -145,8 +143,8 @@ After deployment and configuration, verify that the sample app is running correc
145143

146144
1. Once the app loads, test its functionality:
147145

148-
    - Click **Tools** in the app’s navigation bar.
149-
    - Select **Convert to PNG**.
146+
- Click **Tools** in the app’s navigation bar.
147+
- Select **Convert to PNG**.
150148

151149
![Click `Tools` and select `Convert to PNG`](./media/tutorial-azure-monitor/sample-monitor-app-tools-menu.png)
152150
@@ -156,7 +154,7 @@ After deployment and configuration, verify that the sample app is running correc
156154
157155
![Select the first two images](./media/tutorial-azure-monitor/sample-monitor-app-convert-two-images.png)
158156
159-
## Create a deployment slot
157+
## 5. Create a deployment slot
160158
161159
To simulate a failure scenario, create a secondary deployment slot.
162160
@@ -167,10 +165,10 @@ To simulate a failure scenario, create a secondary deployment slot.
167165
1. Enter the following values.
168166
169167
170-
| Property           | Value         | Remarks                          |
171-
    |--------------------|---------------|----------------------------------|
172-
    | Name               | `broken`      | Name of the slot to simulate failure |
173-
    | Clone settings from| `my-sre-app`  | Copies configuration from the main app |
168+
| Property           | Value         | Remarks                          |
169+
|--------------------|---------------|----------------------------------|
170+
| Name               | `broken`      | Name of the slot to simulate failure |
171+
| Clone settings from| `my-sre-app`  | Copies configuration from the main app |
174172
175173
176174
1. Scroll to the bottom of the dialog window and select **Add**.
@@ -185,15 +183,15 @@ To simulate a failure scenario, create a secondary deployment slot.
185183
186184
In the *Settings* tab, configure the following:
187185
188-
    | Property   | Value                                                              |
189-
    |------------|--------------------------------------------------------------------|
190-
    | Source     | **External Git**                                                   |
191-
    | Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial`     |
192-
    | Branch     | `broken`                                                           |
186+
| Property | Value |
187+
|------------|------------------------------------------------------------|
188+
| Source | **External Git** |
189+
| Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial` |
190+
| Branch | `broken` |
193191
194192
1. Select **Save** to apply the deployment settings.
195193
196-
## Create an SRE Agent
194+
## 6. Create an SRE Agent
197195
198196
Now, create an Azure SRE Agent to monitor your App Service app.
199197
@@ -203,15 +201,15 @@ Now, create an Azure SRE Agent to monitor your App Service app.
203201
204202
1. In the *Create agent* window, enter the following values:
205203
206-
    > During this step, you’ll create a new resource group for the agent. This group is separate from the one used for your app.
204+
> During this step, you’ll create a new resource group for the agent. This group is separate from the one used for your app.
207205
208-
    | Property         | Value                     | Remarks                                                                 |
209-
    |------------------|---------------------------|-------------------------------------------------------------------------|
210-
    | Subscription     | Your Azure subscription   |                                                                         |
211-
    | Resource group   | `my-sre-agent-group`      | New group for the SRE Agent                                             |
212-
    | Name             | `my-app-service-sre-agent`|                                                                         |
213-
    | Region           | **Sweden Central**        | Required during preview; can monitor resources in any Azure region     |
214-
    | Choose role      | **Contributor**           | Grants the agent permission to take action on your behalf              |
206+
| Property | Value | Remarks |
207+
|------------------|---------------------------|-------------------------------------------------------------------------|
208+
| Subscription | Your Azure subscription | |
209+
| Resource group | `my-sre-agent-group` | New group for the SRE Agent |
210+
| Name | `my-app-service-sre-agent`| |
211+
| Region | **Sweden Central** | Required during preview; can monitor resources in any Azure region |
212+
| Choose role | **Contributor** | Grants the agent permission to take action on your behalf |
215213
216214
1. Select **Select resource groups**.
217215
@@ -221,10 +219,9 @@ Now, create an Azure SRE Agent to monitor your App Service app.
221219
222220
1. Back in the *Create agent* window, select **Create**.
223221
224-
    > The agent creation process may take a few minutes to complete.
225-
222+
> The agent creation process may take a few minutes to complete.
226223
227-
## Chat with your agent
224+
## 7. Chat with your agent
228225
229226
Once your SRE Agent is deployed and connected to your resource group, you can interact with it using natural language to monitor and troubleshoot your app.
230227
@@ -244,9 +241,7 @@ Once your SRE Agent is deployed and connected to your resource group, you can in
244241
245242
Now that the agent can see your app, you’re ready to simulate a failure and let the agent help you resolve it.
246243
247-
248-
249-
## Break the app
244+
## 8. Break the app
250245
251246
Now simulate a failure scenario by swapping to the broken deployment slot.
252247
@@ -255,11 +250,11 @@ Now simulate a failure scenario by swapping to the broken deployment slot.
255250
1. Select **Swap**.
256251
257252
1. In the *Swap* dialog, configure the following:
258-
259-
    | Property | Value             | Remarks                          |
260-
    |----------|-------------------|----------------------------------|
261-
    | Source   | `my-sre-app-broken` | The slot with the faulty version |
262-
    | Target   | `my-sre-app`        | The production slot              |
253+
254+
| Property | Value | Remarks |
255+
|----------|---------------------|----------------------------------|
256+
| Source | `my-sre-app-broken` | The slot with the faulty version |
257+
| Target | `my-sre-app` | The production slot |
263258
264259
1. Scroll to the bottom and select **Start Swap**.
265260
@@ -269,18 +264,17 @@ Now simulate a failure scenario by swapping to the broken deployment slot.
269264
270265
1. Attempt to convert five images using the app interface:
271266
272-
    ./media/tutorial-azure-monitor/sample-monitor-app-convert-five-images.png
267+
    ![Select the first five images](./media/tutorial-azure-monitor/sample-monitor-app-working.png)
273268
274269
1. The conversion should fail and return an HTTP 500 error:
275270
276-
    ./media/tutorial-azure-monitor/sample-monitor-app-http-500.png
271+
    ![HTTP 500](./media/tutorial-azure-monitor/sample-monitor-app-http-500.png)
277272
278273
1. Repeat the conversion step a few more times to generate additional HTTP 500 logs.
279274
280275
    > These logs will help the SRE Agent detect and diagnose the issue.
281276
282-
283-
## Fix the app
277+
## 9. Fix the app
284278
285279
Now that the app is experiencing failures, use the SRE Agent to diagnose and resolve the issue.
286280
@@ -304,7 +298,7 @@ Now that the app is experiencing failures, use the SRE Agent to diagnose and res
304298
305299
1. After a short delay, the agent will prompt you to approve the rollback:
306300
307-
    > *Performing Slot Swap rollback to Restore Application Availability for my-sre-app* 
301+
    > *Performing Slot Swap rollback to Restore Application Availability for my-sre-app*
308302
    > **[Approve]**   **[Deny]**
309303
310304
1. Select **Approve** to initiate the rollback.
@@ -318,8 +312,7 @@ Now that the app is experiencing failures, use the SRE Agent to diagnose and res
318312
    >
319313
    > *Please provide the GitHub repository URL where you want the issue to be raised.*
320314
321-
322-
## Verify the fix
315+
## 10. Verify the fix
323316
324317
After the SRE Agent rolls back the slot swap, confirm that your app is functioning correctly.
325318

0 commit comments

Comments
 (0)