Skip to content

Commit e756e7d

Browse files
committed
updates
1 parent 611a209 commit e756e7d

File tree

1 file changed

+32
-43
lines changed

1 file changed

+32
-43
lines changed

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

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ In this tutorial, you will:
2929

3030
## Prerequisites
3131

32-
To complete this tutorial, you need an [Azure subscription](https://azure.microsoft.com/free/).
32+
To complete this tutorial, you need:
33+
- An [Azure subscription](https://azure.microsoft.com/free/).
34+
- To create the SRE Agent, your account needs Microsoft.Authorization/roleAssignments/write permissions using either Role Based Access Control Administrator or User Access Administrator.
3335

3436
## 1. Create an App Service app
3537

@@ -39,7 +41,6 @@ Start by creating a web app that the SRE Agent can monitor.
3941
1. In the top search bar, search for **App Services**, then select it from the results.
4042
1. Select **+ Create** and choose **Web App**.
4143

42-
4344
### Configure the Basics tab
4445

4546
In the *Basics* tab, provide the following details:
@@ -87,11 +88,11 @@ Now that your App Service app is created, deploy the sample application from Git
8788

8889
1. In the *Settings* tab, configure the following:
8990

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

9697
1. Select **Save** to apply the deployment settings.
9798

@@ -105,7 +106,6 @@ The sample app uses NGINX. The default NGINX configuration expects a `50x.html`
105106

106107
1. In the left menu, browse to the *Settings* section and select **Configuration**.
107108

108-
109109
1. Under the *General settings* tab, locate the **Startup Command** field.
110110

111111
1. Enter the following command:
@@ -127,7 +127,7 @@ Enable logging so the SRE Agent can collect diagnostic data from your app.
127127
| Property | Value | Remarks |
128128
|------------------------|-----------------|----------------------------------------|
129129
| Application logging | **File System** | Enables log collection for diagnostics |
130-
| Retention Period (Days)| `3` | Retains logs for 3 days |
130+
| Retention Period (Days)| `3` | Retains logs for 3 days |
131131

132132
1. Select **Save** to apply the logging configuration.
133133

@@ -171,9 +171,7 @@ To simulate a failure scenario, create a secondary deployment slot.
171171
| Clone settings from| `my-sre-app`  | Copies configuration from the main app |
172172
173173
174-
1. Scroll to the bottom of the dialog window and select **Add**.
175-
176-
> The slot creation process may take a minute to complete.
174+
1. Scroll to the bottom of the dialog window and select **Add**. The slot creation process may take a minute to complete.
177175
178176
### Configure the deployment slot
179177
@@ -183,11 +181,11 @@ To simulate a failure scenario, create a secondary deployment slot.
183181
184182
In the *Settings* tab, configure the following:
185183
186-
| Property | Value |
187-
|------------|------------------------------------------------------------|
188-
| Source | **External Git** |
189-
| Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial` |
190-
| Branch | `broken` |
184+
| Property | Value |
185+
|------------|--------------------------------------------------------------|
186+
| Source | **External Git** |
187+
| Repository | `https://github.com/Azure-Samples/App-Service-Agent-Tutorial`|
188+
| Branch | `broken` |
191189
192190
1. Select **Save** to apply the deployment settings.
193191
@@ -201,8 +199,6 @@ Now, create an Azure SRE Agent to monitor your App Service app.
201199
202200
1. In the *Create agent* window, enter the following values:
203201
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.
205-
206202
| Property | Value | Remarks |
207203
|------------------|---------------------------|-------------------------------------------------------------------------|
208204
| Subscription | Your Azure subscription | |
@@ -256,9 +252,7 @@ Now simulate a failure scenario by swapping to the broken deployment slot.
256252
| Source | `my-sre-app-broken` | The slot with the faulty version |
257253
| Target | `my-sre-app` | The production slot |
258254
259-
1. Scroll to the bottom and select **Start Swap**.
260-
261-
    > The swap may take a minute to complete.
255+
1. Scroll to the bottom and select **Start Swap**. The swap operation may take a minute to complete.
262256
263257
1. Once the swap is complete, browse to the app’s URL.
264258
@@ -270,9 +264,7 @@ Now simulate a failure scenario by swapping to the broken deployment slot.
270264
271265
    ![HTTP 500](./media/tutorial-azure-monitor/sample-monitor-app-http-500.png)
272266
273-
1. Repeat the conversion step a few more times to generate additional HTTP 500 errors.
274-
275-
    > These errors help the SRE Agent detect and diagnose the issue.
267+
1. Repeat the conversion step a few more times to generate additional HTTP 500 errors. These errors help the SRE Agent detect and diagnose the issue.
276268
277269
## 9. Fix the app
278270
@@ -286,42 +278,39 @@ Now that the app is experiencing failures, use the SRE Agent to diagnose and res
286278
287279
1. In the chat box, enter the following command:
288280
289-
    ```text
290-
    What's wrong with my-sre-app?
291-
    ```
281+
```text
282+
What's wrong with my-sre-app?
283+
```
292284
293285
1. The agent will begin analyzing the app’s health. You’ll see diagnostic messages related to availability, CPU and memory usage, and the recent slot swap.
294286
295-
    > Each session may vary, but you should see a message similar to:
296-
    >
297-
    > *“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.”*
287+
> Each session may vary, but you should see a message similar to:
288+
>
289+
> *“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.”*
298290
299291
1. After a short delay, the agent will prompt you to approve the rollback:
300292
301-
    > *Performing Slot Swap rollback to Restore Application Availability for my-sre-app*
302-
    > **[Approve]**   **[Deny]**
293+
> *Performing Slot Swap rollback to Restore Application Availability for my-sre-app*
294+
> **[Approve]**   **[Deny]**
303295
304296
1. Select **Approve** to initiate the rollback.
305297
306298
1. Once the rollback is complete, the agent confirms:
307299
308-
    > *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:*
309-
    >
310-
    > *• I will ask you for the correct GitHub repo URL to raise an issue for the swap-related downtime.* 
311-
    > *• I will monitor the app and provide an availability update in 5 minutes.* 
312-
    >
313-
    > *Please provide the GitHub repository URL where you want the issue to be raised.*
300+
> *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:*
301+
>
302+
> *• I will ask you for the correct GitHub repo URL to raise an issue for the swap-related downtime.* 
303+
> *• I will monitor the app and provide an availability update in 5 minutes.* 
304+
>
305+
> *Please provide the GitHub repository URL where you want the issue to be raised.*
314306
315307
## 10. Verify the fix
316308
317309
After the SRE Agent rolls back the slot swap, confirm that your app is functioning correctly.
318310
319311
1. Open your App Service app in a browser by selecting **Browse** from the **Overview** page.
320312
321-
1. In the app interface:
322-
323-
    - Select **Tools** in the navigation bar.
324-
    - Select **Convert to PNG**.
313+
1. In the app interface, select **Tools** in the navigation bar and select **Convert to PNG**.
325314
326315
    ![Select `Tools` and select `Convert to PNG`](./media/tutorial-azure-monitor/sample-monitor-app-tools-menu.png)
327316

0 commit comments

Comments
 (0)