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
+63-24Lines changed: 63 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ In the *Basics* tab, do the following actions.
60
60
61
61
1. Select the **Deployment** tab.
62
62
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.
64
64
65
65
1. Select **Review and create** at the bottom of the page.
66
66
@@ -76,27 +76,39 @@ In the *Basics* tab, do the following actions.
76
76
77
77
1. To view your new App Service, select **Go to resource**.
78
78
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**.
86
80
87
81
1. Enter the following values in the *Settings* tab.
88
82
89
83
| Property | Value | Remarks |
90
84
|---|---|---|
91
85
| 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
+
```
94
106
95
107
1. Select **Save**.
96
108
97
109
### Enable App Service logs
98
110
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.
100
112
101
113
1. In the left menu, browse to the *Monitoring* section and select**App Service logs**.
102
114
@@ -113,23 +125,49 @@ This step is required to create applicaton logs that the SRE Agent can use to tr
113
125
114
126
1. Select **Overview**in the left menu.
115
127
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.
117
129
118
130
1. To convert images, click `Tools` and select`Convert to PNG`.
119
131
120
132

121
133
122
-
1. Select the first two images and click `convert`. This converts successfully.
134
+
1. Select three images and click `convert`. This converts successfully.
123
135
124
136

125
137
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
127
165
128
166
Next, create an agent to monitor the *my-aca-app-group* resource group.
129
167
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**.
131
169
132
-
1. Select **Create**.
170
+
1. Select **Create**. This can take a few minutes to complete.
133
171
134
172
1. Enter the following values in the *Create agent* window.
135
173
@@ -141,6 +179,7 @@ Next, create an agent to monitor the *my-aca-app-group* resource group.
141
179
| Resource group | Enter **my-sre-agent-group**. ||
142
180
| Name | Enter **my-app-service-sre-agent**. ||
143
181
| 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**. ||
144
183
145
184
1. Select the **Select resource groups** button.
146
185
@@ -150,7 +189,7 @@ Next, create an agent to monitor the *my-aca-app-group* resource group.
150
189
151
190
1. Select **Create**.
152
191
153
-
## 3. Chat with your agent
192
+
## 5. Chat with your agent
154
193
155
194
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.
156
195
@@ -166,23 +205,23 @@ Your agent has access to any resource inside the resource groups associated with
166
205
List my app service apps
167
206
```
168
207
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.
170
209
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.
172
211
173
-
## 4. Break the app
212
+
## 6. Break the app
174
213
175
214
1. Now that the agent has been created, browse to the app's URL.
176
215
177
-
1. Try to convert the first five images.
216
+
1. Try to convert all the images.
178
217
179
218

180
219
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.
182
221
183
222

184
223
185
-
## 5. Fix the app
224
+
## 7. Fix the app
186
225
187
226
1. Go to the Azure portal, search for and select**Azure SRE Agent**.
188
227
@@ -230,7 +269,7 @@ This action fails and produces a `HTTP 500` error that wasn't tested during deve
230
269
231
270
> 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.
232
271
233
-
## 6. Verify repair
272
+
## 8. Verify repair
234
273
235
274
Now you can prompt your agent to return your app's fully qualified domain name (FQDN) so you can verify a successful deployment.
0 commit comments