Implement azd update to use installation script for Windows#7166
Implement azd update to use installation script for Windows#7166hemarina wants to merge 7 commits intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Windows MSI update flow in azd to run the official install-azd.ps1 script, adding safety checks (other running processes, standard install location) and a rollback mechanism (rename current exe to a backup and restore on failure).
Changes:
- Replace the previous detached
msiexecMSI update approach with a synchronous PowerShell install-script based workflow. - Add Windows-specific helpers for detecting other
azdprocesses, validating install location, and backing up/restoring the current executable. - Introduce new update error codes and add Windows unit tests for the new MSI update helpers/guardrails.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
cli/azd/pkg/update/msi_windows.go |
Adds Windows MSI update helper functions (process check, install-dir check, exe backup/restore, PowerShell arg builder). |
cli/azd/pkg/update/msi_windows_test.go |
Adds unit tests for the new Windows MSI update helper logic and new error codes. |
cli/azd/pkg/update/msi_unix.go |
Adds non-Windows stubs for new Windows-only MSI helper functions. |
cli/azd/pkg/update/manager.go |
Reworks updateViaMSI to use the PowerShell install script and exe backup/rollback flow; removes MSI URL download helper. |
cli/azd/pkg/update/errors.go |
Adds new update result codes for “other processes running” and “non-standard install”. |
You can also share your feedback on Copilot code review. Take the survey.
… replaced by new azd exe
There was a problem hiding this comment.
Pull request overview
Refactors the Windows azd update MSI path to run the official PowerShell install script, enforce the standard per-user MSI install directory, and introduce executable backup/restore handling to reduce the chance of leaving users without a working azd.exe.
Changes:
- Switch Windows MSI update flow to invoke
https://aka.ms/install-azd.ps1with channel-specific flags. - Enforce standard per-user MSI install location and introduce a new update error code for non-standard installs.
- Add Windows-specific helpers/tests (backup/restore, install-dir validation, script arg construction) and no-op stubs for non-Windows builds.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ext/vscode/.vscode/cspell-dictionary.txt | Adds spellcheck allowlist entries referenced in the Windows MSI configuration/update work. |
| cli/azd/pkg/update/msi_windows_test.go | Adds Windows-only unit tests for install-dir detection, script arg construction, and basic backup/restore behaviors. |
| cli/azd/pkg/update/msi_windows.go | Implements Windows-specific MSI update helpers (install-dir validation, exe backup/restore, PowerShell install script invocation args). |
| cli/azd/pkg/update/msi_unix.go | Adds non-Windows stubs to keep builds compiling while concentrating MSI logic on Windows. |
| cli/azd/pkg/update/manager.go | Reworks updateViaMSI to use install script + backup/restore flow and improves currentExePath error wrapping. |
| cli/azd/pkg/update/errors.go | Adds CodeNonStandardInstall for telemetry/error classification. |
| cli/azd/cmd/update.go | Minor success message wording tweak. |
You can also share your feedback on Copilot code review. Take the survey.
VSCode Extension Installation Instructions
|
danieljurek
left a comment
There was a problem hiding this comment.
A few useless tests but otherwise logic looks good.
To solve the tests, they need to call the funcs they're testing... if it can't be done easily because of reliance on function calls that can't be faked, then delete them. Another solution would be to inject the needed information into the function and test based on inputs/outputs that you control.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fix #7168
This pull request introduces significant improvements to the Windows MSI update process for the Azure Dev CLI (
azd), focusing on reliability, safety, and clearer user messaging. The update flow now includes robust backup and recovery mechanisms, stricter checks for standard installation paths, and improved handling of the running executable during updates. Additionally, platform-specific stubs are provided for non-Windows systems, and minor messaging and dictionary updates are included.Windows MSI Update Reliability and Safety:
manager.gonow:azdis installed in the standard per-user MSI location before proceeding. If not, the update aborts and instructs the user to reinstall using the standard configuration. [1] [2] [3]install-azd.ps1) to perform the update, with arguments constructed to match the selected channel and ensure script execution regardless of system policy. [1] [2]Platform-Specific Handling:
General Improvements and Messaging:
Summary of Most Important Changes:
Windows MSI Update Reliability:
azd.execan be recovered if the update fails. [1] [2]install-azd.ps1) for updates, with dynamically constructed arguments for channel selection and script execution. [1] [2]Platform-Specific Stubs:
General Improvements: