Warn about Device Guard / WDAC blocking after az upgrade MSI install - #33920
Warn about Device Guard / WDAC blocking after az upgrade MSI install#33920Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
az upgrade MSI install#33920Conversation
|
Hi Copilot, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
az upgrade MSI install
Live test results —
|
There was a problem hiding this comment.
CI Review — PR #33920
The live-test workflow passed successfully. However, one required CI check
is currently failing:
Azure.azure-cli(Build #20260818.18) — https://github.com/Azure/azure-cli/runs/95796544110
Looking at the Azure DevOps build logs (buildId 339177), the failure trace shows:
##[error]The Operation will be canceled. The next steps may not contain expected logs.
fatal: early EOF
##[error]The operation was canceled.
This occurred during the Checkout step (Checkout Azure/azure-cli@copilot/fix-azure-cli-289-issue)
while cloning the repository, which in turn caused the dependent Unit Test for Core Python312 job
to be canceled. This looks like a transient infrastructure hiccup (an interrupted/canceled git clone)
rather than an issue introduced by this PR's changes.
Copilot please take a look — if the change itself doesn't explain the checkout failure, this is
likely a flaky CI infrastructure issue and re-running the pipeline (e.g. via a new commit or asking
a maintainer to restart the failed job) should resolve it. If you do find something in the diff that
could plausibly affect checkout/build (e.g. very large added files, submodule changes), please fix it.
Posted by agent-assist (autonomous bug-fix pipeline).
|
Started a Copilot task using Posted by agent-assist (autonomous bug-fix pipeline). |
The CI failure was a transient infrastructure issue — the build was canceled due to an |
|
🔔 Routing this PR to @Azure/act-platform-engineering-squad. |
|
Thanks for the quick analysis and PR. The added warning is useful, but I think it still leaves the core problem unresolved: az upgrade can successfully install a newer CLI version and leave the machine with a completely unusable Azure CLI afterwards. In our case on Azure Local: 2.85.0 working → az upgrade --yes installs 2.89.1 → WDAC blocks the bundled python.exe → az no longer starts → rollback to 2.85.0 restores functionality A warning before or during the upgrade helps, but it still requires the administrator to discover the breakage afterwards and perform a manual rollback. Would it be possible to add a post-install verification step, for example by invoking az version or the newly installed python.exe, and treat the upgrade as failed if the new installation cannot start? If feasible, an automatic rollback to the previously working CLI version would be even better. This would match the original bug analysis more closely and would prevent az upgrade from leaving a previously healthy Azure Local node with a broken CLI. |
|
az upgrade |
Related command
az upgradeDescription
On machines enforcing Device Guard / Windows Defender Application Control (WDAC) code integrity policies (e.g. Azure Local cluster nodes),
az upgradecan install a newer MSI whose bundledpython.exeis blocked by the policy, leaving a previously working Azure CLI unusable. The CLI has no supported way to query the enforced WDAC policy or predict whether a specific binary will be allowed, so this can't be reliably auto-detected before the upgrade runs.custom.py:_upgrade_on_windows()now logs a warning during the MSI upgrade flow reminding users on locked-down machines to verifyaz versionworks after upgrading, and pointing to the rollback path if it's blocked.doc/install_troubleshooting.md: Added a troubleshooting section documenting the symptom (Code Integrity Event IDs 3033/3077, "blocked by your organization's Device Guard policy") with remediation steps — roll back to the previous MSI, stage-test upgrades before broad rollout across a cluster, or engage the policy administrator._upgrade_on_windows().Testing Guide
History Notes
[Core]
az upgrade: Warn about Device Guard / WDAC policies potentially blocking the CLI after a Windows MSI upgradeThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.