Description
On the first run of azd up in a fresh environment (e.g., new devcontainer), the following error occurs:
\
ERROR: loading environment: saving local environment, locking .env: context canceled
\\
The error does not reproduce on subsequent runs — something gets cached that prevents it. Deleting .azure/ does not reproduce the issue.
Screenshots

Context
- Reported by @john0isaac in PR #7776 comment
- Likely pre-existing (env locking code unchanged in exegraph PR)
- Suggests a race condition between environment creation and .env file locking on first run
Repro Steps
- Install azd in a fresh environment (devcontainer)
- Run
azd up for the first time
- Observe the context canceled error on .env locking
/cc @john0isaac
Description
On the first run of
azd upin a fresh environment (e.g., new devcontainer), the following error occurs:\
ERROR: loading environment: saving local environment, locking .env: context canceled
\\
The error does not reproduce on subsequent runs — something gets cached that prevents it. Deleting
.azure/does not reproduce the issue.Screenshots
Context
Repro Steps
azd upfor the first time/cc @john0isaac