Skip to content

[Util] Fix #33919: az upgrade: Warn about Device Guard / WDAC blocking after MSI install - #33920

Open
Aditya Pujara (a0x1ab) with Copilot wants to merge 15 commits into
devfrom
copilot/fix-azure-cli-289-issue
Open

[Util] Fix #33919: az upgrade: Warn about Device Guard / WDAC blocking after MSI install#33920
Aditya Pujara (a0x1ab) with Copilot wants to merge 15 commits into
devfrom
copilot/fix-azure-cli-289-issue

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command
az upgrade

Description

On machines enforcing Device Guard / Windows Defender Application Control (WDAC) code integrity policies (e.g. Azure Local cluster nodes), az upgrade can install a newer MSI whose bundled python.exe is 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 verify az version works 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.
  • Tests: Added a unit test asserting the new warning is emitted during _upgrade_on_windows().

Testing Guide

python -m unittest azure.cli.command_modules.util.tests.latest.test_upgrade

History Notes

[Core] az upgrade: Warn about Device Guard / WDAC policies potentially blocking the CLI after a Windows MSI upgrade


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Copilot,
Since the current milestone time is less than 7 days, this pr may not catch up with this release.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
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>
Copilot AI requested review from a team as code owners August 18, 2026 14:41
Copilot AI changed the title [WIP] Fix Azure CLI 2.89.1 upgrade issue with WDAC policy Warn about Device Guard / WDAC blocking after az upgrade MSI install Aug 18, 2026
@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_upgrade (module)
PR head ref: copilot/fix-azure-cli-289-issue
PR head sha: 74764f422f2c97942dd4f1efb6fa65ba14d8e69c
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

New test files
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32156728532

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13640: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_upgrade

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 1 item

azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_upgrade_on_windows_warns_about_code_integrity_policies PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 1 passed in 0.09s ===============================

Posted by agent-assist live-test workflow.

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Review — PR #33920

The live-test workflow passed successfully. However, one required CI check
is currently failing:

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).

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Started a Copilot task using claude-sonnet-4.6 for the automated review at #33920 (review): https://github.com/Azure/azure-cli/tasks/c2d7a191-e63e-4e5d-8783-e5162da04572


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

CI Review — PR #33920

The live-test workflow passed successfully. However, one required CI check...

The CI failure was a transient infrastructure issue — the build was canceled due to an early EOF during the git clone/checkout step, which is unrelated to the PR's code changes. There are no large files, submodule changes, or anything in the diff that could affect checkout. Re-triggering CI now by pushing to the branch.

Copilot AI requested a review from a team as a code owner August 21, 2026 11:22

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

CI Failure Summary

The live test passed, but Azure Pipelines CI reported a failure:...

Root cause identified and fixed in the latest commit.

Root cause: Azure Linux 4.0 (Beta) removed the /usr/lib64 → /usr/lib backward-compatibility symlink that AZL3 still carries. On Azure Linux, %{_libdir} expands to /usr/lib, so the RPM installs azure-cli under /usr/lib/az. Three places hardcoded lib64, which worked on AZL3 (via the symlink) but broke on AZL4 where the symlink no longer exists.

Fix (3 files):

  • azure-cli.spec: The generated /usr/bin/az entry script now probes lib64/az first (Fedora/RHEL) and falls back to lib/az (Azure Linux 4.0+) at runtime, so it works with both distributions and custom relocatable prefixes.
  • test_azurelinux_in_docker.sh: Detects the actual az install directory (/usr/lib/az on Azure Linux, /usr/lib64/az otherwise) before installing pytest packages, and passes AZ_LIB_DIR explicitly to the test script.
  • test_rpm_package.py: Uses the AZ_LIB_DIR env var when set by the caller, otherwise auto-detects via os.path.isdir instead of hardcoding /usr/lib64/az.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_upgrade (module)
PR head ref: copilot/fix-azure-cli-289-issue
PR head sha: 6c3a31b455c47250026e713ed77709b8f12cd377
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

New test files
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32478395163

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13705: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_upgrade

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 5 items

azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_32bit_uses_correct_msi_url PASSED [ 20%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_msiexec_failure_exits_with_msi_exit_code PASSED [ 40%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_restart_required_warns_and_exits_zero PASSED [ 60%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_successful_upgrade_exits_zero PASSED [ 80%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_wdac_blocking_exits_nonzero_and_warns PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 5 passed in 0.16s ===============================

Posted by agent-assist live-test workflow.

@x-engineering-agent x-engineering-agent Bot changed the title Warn about Device Guard / WDAC blocking after az upgrade MSI install [Util] Fix #33919: az upgrade: Warn about Device Guard / WDAC blocking after MSI install Aug 21, 2026

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Failure Summary

Live test passed, but 2 required checks are failing on this PR (head commit 6c3a31b):

  1. Azure.azure-cli (build) — failed: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=340543
  2. Azure.azure-cli (Check the Format of Pull Request Title and Content) — failed: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=340543

The PR title itself is already compliant ([Util] Fix #33919: \az upgrade`: Warn about Device Guard / WDAC blocking after MSI install), so the title/content check failure is likely due to missing required PR description content (e.g. #33919` link format, history entry, or other required section) — please review the Azure Pipelines build log linked above for the exact validation error and also inspect the build failure log for the root cause.

Please fix both failures.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Started a Copilot task using claude-sonnet-4.6 for the automated review at #33920 (review): https://github.com/Azure/azure-cli/tasks/7b31aea9-e6c0-43c4-9151-602e9c96b74c

Azure Linux 4.0 removed the /usr/lib64 -> /usr/lib symlink that AZL3 carried.
On Azure Linux, %{_libdir} expands to /usr/lib, so the CLI RPM is installed to
/usr/lib/az. The previous code hardcoded lib64 in three places, which worked on
AZL3 (via the symlink) but broke on AZL4.

- azure-cli.spec: generated /usr/bin/az entry script now probes lib64 first then
  falls back to lib at runtime, supporting both Fedora/RHEL and Azure Linux 4+.
- test_azurelinux_in_docker.sh: detects the actual az install dir before
  installing pytest and passes AZ_LIB_DIR to the test script.
- test_rpm_package.py: uses AZ_LIB_DIR env var or auto-detects via os.path.isdir
  instead of hardcoding /usr/lib64/az.

Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

CI Failure Summary

Live test passed, but 2 required checks are failing on this PR (head commit 6c3a31b):...

Investigated both failures from buildId=340543:

  1. Build failure (Azure.azure-cli): Root cause was the Azure Linux 4.0 (Beta) ARM64 RPM test failing because AZL4 removed the /usr/lib64 → /usr/lib symlink. Already fixed in commit 6c3a31b (probes lib64 first, falls back to lib). The new build (340553) confirms this — Azure.azure-cli (Build Rpm Package Azure Linux 4.0 (Beta) ARM64) passes.

  2. Format check failure (Check the Format of Pull Request Title and Content): The check_pull_request.py script was passing locally against the PR title and history note. Most likely this was a transient failure (CI running while the PR bot was updating the body). Additionally added the missing HISTORY.rst entry for the az upgrade WDAC warning in 2.89.1 in commit ab77490.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_upgrade (module)
PR head ref: copilot/fix-azure-cli-289-issue
PR head sha: ab7749081929799844029ec17840314cc0881f6c
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

New test files
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32486561833

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13705: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_upgrade

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 5 items

azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_32bit_uses_correct_msi_url PASSED [ 20%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_msiexec_failure_exits_with_msi_exit_code PASSED [ 40%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_restart_required_warns_and_exits_zero PASSED [ 60%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_successful_upgrade_exits_zero PASSED [ 80%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_wdac_blocking_exits_nonzero_and_warns PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 5 passed in 0.17s ===============================

Posted by agent-assist live-test workflow.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: payment card
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because Agent Assist cannot edit another user's text: @azure-client-tools-agent[bot]

Agent Assist does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: payment card
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because Azure Client Tools Agent cannot edit another user's text: @x-engineering-agent[bot]

Azure Client Tools Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@a0x1ab Aditya Pujara (a0x1ab) added X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent and removed azure-client-tools-agent labels Sep 2, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

🔔 Routing this PR to @Azure/act-platform-engineering-squad.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: payment card
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: @x-engineering-agent[bot]

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_upgrade (module)
PR head ref: copilot/fix-azure-cli-289-issue
PR head sha: 6d14ec0ba38f113959330e24babd7adf25ff6851
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

New test files
src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/34038868008

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13745: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_upgrade

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 5 items

azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_32bit_uses_correct_msi_url PASSED [ 20%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_msiexec_failure_exits_with_msi_exit_code PASSED [ 40%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_restart_required_warns_and_exits_zero PASSED [ 60%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_successful_upgrade_exits_zero PASSED [ 80%]
azure-cli/src/azure-cli/azure/cli/command_modules/util/tests/latest/test_upgrade.py::UpgradeOnWindowsTest::test_wdac_blocking_exits_nonzero_and_warns PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 5 passed in 0.16s ===============================

Posted by the Azure Client Tools Agent live-test workflow.

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review handoff

All CI checks passed (110/110) and the dispatched live test succeeded, but this PR still has an outstanding repository-policy finding and a scope concern. The automated fixer has already made 3 attempts on this PR and reached its iteration cap, so this is being handed off for human review instead of triggering another automated fix cycle.

Test validation

  • Live test: Passed. Workflow run
  • Regression coverage: Present for util: 1 focused test file(s) changed.

Repository policy findings

  • Release artifact validator (blocking)src/azure-cli/HISTORY.rst:134: Azure CLI aggregate history is generated from pull-request metadata and must not be edited directly.
    Remediation: Remove the direct history-file edit. Put one customer-facing note in the [Component] PR title, or put multiple or overriding notes in the PR description's History Notes section.
    Verify: Run the PR title/content check and confirm the release-note generator derives the intended entry from PR metadata.

Scope-consistency finding (evidence-confirmed)

  • Unrelated packaging changes bundled into a Windows-only fixscripts/release/rpm/azure-cli.spec, scripts/release/rpm/test_azurelinux_in_docker.sh, and scripts/release/rpm/test_rpm_package.py all change RPM packaging/test logic to support Azure Linux 4.0's removal of the /usr/lib64 -> /usr/lib symlink (probing lib64 then falling back to lib). None of this is related to the PR's stated purpose (az upgrade: warn about Device Guard/WDAC blocking a Windows MSI upgrade). The .spec change also touches the generated az launcher shell script (bin_dir=... ${BASH_SOURCE[0]}, _az_pypath probing loop).
    Remediation: Split the RPM/Azure-Linux-4.0 packaging fix into its own PR with its own title/History Notes, so each change gets independent review and its History entry accurately describes it. Keep this PR scoped to the Device Guard/WDAC warning in util/custom.py, its test, and the troubleshooting doc.
    Verify: Confirm the util PR alone reproduces/fixes issue #33919, and that the RPM packaging fix is validated independently (e.g. building the RPM against Azure Linux 4.0 and running test_rpm_package.py).

Risk assessment

29/100 · Medium · High confidence

The Medium rating is driven by public CLI behavior, failure-handling behavior.

  • Change scope: 7 changed files, 230 changed lines (+215 / -15), including 1 production file.
  • Affected components: util
  • Risk drivers: public CLI behavior (+18); failure-handling behavior (+12)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is recommended for util before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-platform-engineering-squad Auto-Assign Auto assign by bot Installation X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure CLI 2.89.1 installed by az upgrade is blocked by Azure Local WDAC policy

6 participants