Commit 71de3e6
fix: defer project initialization in env refresh to avoid extension failures
Restructure envRefreshAction.Run() so that:
1. Infrastructure state is retrieved and environment is updated first
2. Service initialization (projectManager.Initialize) is deferred until
after the core env refresh operation completes
3. Service initialization and ServiceEventEnvUpdated are best-effort -
logged warnings instead of fatal errors
This fixes azd env refresh for projects using the azure.ai.agent extension,
where the extension's service target initialization could fail and block
the entire env refresh operation. The core env refresh operation (reading
deployment outputs and updating .env) doesn't require service targets or
framework services to be initialized.
Fixes #7195
Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/ec998279-c8d0-4ad1-98d3-830624a06afd
Co-authored-by: therealjohn <1501196+therealjohn@users.noreply.github.com>1 parent c081662 commit 71de3e6
1 file changed
Lines changed: 34 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | 1155 | | |
1163 | 1156 | | |
1164 | 1157 | | |
| |||
1223 | 1216 | | |
1224 | 1217 | | |
1225 | 1218 | | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1240 | 1243 | | |
1241 | | - | |
1242 | | - | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1243 | 1253 | | |
1244 | 1254 | | |
1245 | 1255 | | |
| |||
0 commit comments