Skip to content

Commit 7847808

Browse files
committed
updates
1 parent f598de1 commit 7847808

File tree

1 file changed

+63
-24
lines changed

1 file changed

+63
-24
lines changed

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

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In the *Basics* tab, do the following actions.
6060

6161
1. Select the **Deployment** tab.
6262

63-
1. Enable **Basic authentication** in the *Authentication settings* section.
63+
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.
6464

6565
1. Select **Review and create** at the bottom of the page.
6666

@@ -76,27 +76,39 @@ In the *Basics* tab, do the following actions.
7676

7777
1. To view your new App Service, select **Go to resource**.
7878

79-
1. Go to the [Azure portal](https://portal.azure.com) and search for **App Services** in the top search bar.
80-
81-
1. Select **App Services** in the search results.
82-
83-
1. Select **my-sre-app** from the list of App Services.
84-
85-
1. In the left menu, select **Deployment center** from the *Deployment* section.
79+
1. In the left menu, find the *Deployment* section and select **Deployment center**.
8680

8781
1. Enter the following values in the *Settings* tab.
8882

8983
| Property | Value | Remarks |
9084
|---|---|---|
9185
| Source | Select **External Git**. | |
92-
| Repository | Enter **https://github.com/Azure-Samples/App-Service-Troubleshoot-Azure-Monitor**. | |
93-
| Branch | Enter **master**. | |
86+
| Repository | Enter **https://github.com/Azure-Samples/App-Service-Agent-Tutorial**. | |
87+
| Branch | Select **working**. | |
88+
89+
1. Select **Save**.
90+
91+
## 2. Configure the app
92+
93+
These steps configure the sample app with a *Startup command* and enable App Service logs.
94+
95+
### Configure the startup command
96+
97+
The default NGINX configuration expects a 50x.html file in the root */html* directory. This startup command copies *50x.html* from the *wwwroot* directory into /*html*.
98+
99+
1. In the left menu, browse to the *Settings* section and select **Configuration**.
100+
101+
1. Copy-paste the startup command as shown:
102+
103+
```bash
104+
/home/site/wwwroot/startup.sh
105+
```
94106

95107
1. Select **Save**.
96108

97109
### Enable App Service logs
98110

99-
This step is required to create applicaton logs that the SRE Agent can use to troubleshoot the app.
111+
This step configures application logs required by the SRE Agent to diagnose and troubleshoot the app.
100112

101113
1. In the left menu, browse to the *Monitoring* section and select **App Service logs**.
102114

@@ -113,23 +125,49 @@ This step is required to create applicaton logs that the SRE Agent can use to tr
113125

114126
1. Select **Overview** in the left menu.
115127

116-
1. Select **Browse** to verify the sample app.
128+
1. Select **Browse** to verify the sample app. It may take a minute to load as Azure App Service initializes the web app instance during the first request.
117129

118130
1. To convert images, click `Tools` and select `Convert to PNG`.
119131
120132
![Click `Tools` and select `Convert to PNG`](./media/tutorial-azure-monitor/sample-monitor-app-tools-menu.png)
121133
122-
1. Select the first two images and click `convert`. This converts successfully.
134+
1. Select three images and click `convert`. This converts successfully.
123135
124136
![Select the first two images](./media/tutorial-azure-monitor/sample-monitor-app-convert-two-images.png)
125137
126-
## 2. Create an agent
138+
## 3. Create a deployment slot
139+
140+
1. In the left menu, find the *Deployment* section and select **Deployment slots**.
141+
142+
1. Select **+ Add** to add a new deployment slot.
143+
144+
1. In the *Add Slot* dialog window, enter **broken**.
145+
146+
1. Scroll to the bottom of the dialog window and Select **Add**. The deployment slot takes a minute to complete.
147+
148+
### Configure the deployment slot
149+
150+
1. Select the **broken** deployment slot.
151+
152+
1. In the left menu, find the *Deployment* section and select **Deployment center**.
153+
154+
1. Enter the following values in the *Settings* tab.
155+
156+
| Property | Value | Remarks |
157+
|---|---|---|
158+
| Source | Select **External Git**. | |
159+
| Repository | Enter **https://github.com/Azure-Samples/App-Service-Agent-Tutorial**. | |
160+
| Branch | Select **broken**. | |
161+
162+
1. Select **Save**.
163+
164+
## 4. Create an agent
127165
128166
Next, create an agent to monitor the *my-aca-app-group* resource group.
129167
130-
1. Go to the Azure portal and search for and select **Azure SRE Agent**.
168+
1. Go to the Azure portal and search for and select **SRE Agent**.
131169
132-
1. Select **Create**.
170+
1. Select **Create**. This can take a few minutes to complete.
133171
134172
1. Enter the following values in the *Create agent* window.
135173
@@ -141,6 +179,7 @@ Next, create an agent to monitor the *my-aca-app-group* resource group.
141179
| Resource group | Enter **my-sre-agent-group**. | |
142180
| Name | Enter **my-app-service-sre-agent**. | |
143181
| 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. |
182+
| Choose role | Select **Contributor role**. | |
144183
145184
1. Select the **Select resource groups** button.
146185
@@ -150,7 +189,7 @@ Next, create an agent to monitor the *my-aca-app-group* resource group.
150189
151190
1. Select **Create**.
152191
153-
## 3. Chat with your agent
192+
## 5. Chat with your agent
154193
155194
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.
156195
@@ -166,23 +205,23 @@ Your agent has access to any resource inside the resource groups associated with
166205
List my app service apps
167206
```
168207
169-
1. The agent responds with details about the container app deployed in the *my-aca-app-group* resource group.
208+
1. The agent responds with details about the container app deployed in the *my-app-service-group* resource group.
170209
171-
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.
210+
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.
172211
173-
## 4. Break the app
212+
## 6. Break the app
174213
175214
1. Now that the agent has been created, browse to the app's URL.
176215
177-
1. Try to convert the first five images.
216+
1. Try to convert all the images.
178217
179218
![Convert first five images](./media/tutorial-azure-monitor/sample-monitor-app-convert-five-images.png)
180219
181-
This action fails and produces a `HTTP 500` error that wasn't tested during development.
220+
This action fails and produces an error that wasn't tested during development.
182221
183222
![The convert will result in a HTTP 500 error](./media/tutorial-azure-monitor/sample-monitor-app-http-500.png)
184223
185-
## 5. Fix the app
224+
## 7. Fix the app
186225
187226
1. Go to the Azure portal, search for and select **Azure SRE Agent**.
188227
@@ -230,7 +269,7 @@ This action fails and produces a `HTTP 500` error that wasn't tested during deve
230269
231270
> Rollback complete! Your container app has been reverted to the last known working image: mcr.microsoft.com/k8se/quickstart:latest. Please monitor your app to ensure it starts successfully.
232271
233-
## 6. Verify repair
272+
## 8. Verify repair
234273
235274
Now you can prompt your agent to return your app's fully qualified domain name (FQDN) so you can verify a successful deployment.
236275

0 commit comments

Comments
 (0)