Repository navigation
registry: install azure-cli from the official Windows zip - #12161
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe Azure CLI registry entry adds a Windows GitHub backend for bundled-python ZIP releases. Windows ARM64 uses the x64 asset. The pipx backend remains the fallback for non-Windows platforms. ChangesAzure CLI backend
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to This change routes Windows x64 to the official Azure CLI ZIP with its bundled Python while preserving the existing installation path on other platforms and Windows ARM64. The change is mergeable, but maintainers should explicitly confirm version resolution for both installation sources as a bounded registry integration follow-up. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR switches Azure CLI installation on Windows to Microsoft’s official ZIP while retaining the existing pipx backend elsewhere.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "registry(azure-cli): cover Windows ARM64..." | Re-trigger Greptile |
The PyPI package cannot produce a working `az` on Windows. azure-cli ships no `console_scripts` entry point -- it was adopted in Azure/azure-cli#1014 and reverted a week later in Azure/azure-cli#1042 over startup cost, and proposed again and declined in Azure/azure-cli#10900 -- so pip and uv generate no `.exe` launcher and copy the package's own `az.bat` verbatim. That script resolves the interpreter next to itself: IF EXIST "%~dp0\python.exe" ( "%~dp0\python.exe" -m azure.cli %* ) ELSE ( python -m azure.cli %* ) which only holds inside the venv's `Scripts` directory, not in the bin directory `UV_TOOL_BIN_DIR` / `PIPX_BIN_DIR` point at. The else branch then runs whichever `python` is on PATH, so `az --version` fails with a missing `python` or `ModuleNotFoundError: No module named 'azure'`. Unix is unaffected because pip rewrites the `az` script's shebang to the venv interpreter; a `.bat` has no shebang to rewrite. The official Windows zip has no such assumption: it bundles `python.exe` at its root and its `bin/az.cmd` reaches it with `%~dp0\..\python.exe`, so it works wherever mise unpacks it, and `bin/` is already where mise looks for binaries. This also moves the platform that was broken from a tier 3 backend to a tier 1 one. Windows x64 only. There is no Linux release asset, and the macOS tarball does not bundle python -- outside a Homebrew Cask path its launcher requires AZ_PYTHON -- so both keep using pipx, where they work today. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
810046a to
4ff8708
Compare
|
Thanks for digging into this. I checked the pipx/Python behavior and Windows ARM64 before deciding. The Python dependency added in #9678 only puts mise-managed Python on PATH while mise runs I don't think Windows ARM64 should fall through to Microsoft currently publishes only an x64 Windows ZIP, but Windows 11 ARM supports transparent x64 user-mode emulation. This ZIP is a self-contained x64 Python application with no driver component, and mise's aqua backend already treats Windows AMD64 packages as compatible with ARM64 for the same reason. Please test the x64 ZIP on GitHub's [[backends]]
full = "github:Azure/azure-cli"
platforms = ["windows"]
[backends.options]
version_prefix = "azure-cli-"
[backends.options.platforms.windows-arm64]
asset_pattern = "azure-cli-{{ version }}-x64.zip"The ARM64 smoke test should install through mise, execute If that cannot be validated, please instead scope the AI-assisted — Tool: Codex; model: unavailable; version: unavailable. |
|
Tested it on The runner and the driver are both genuinely ARM64, which matters — an x64 mise under emulation would detect Config mirroring the proposed entry, since the registry is compiled in: "github:Azure/azure-cli" = { version = "2.89.1", version_prefix = "azure-cli-", asset_pattern = "azure-cli-{{ version }}-x64.zip" }Results — install, On confirming the interpreter is the x64 build, one detail is worth stating exactly, because the obvious check answers a different question:
The registry entry now reads: [[backends]]
full = "github:Azure/azure-cli"
platforms = ["windows"]
[backends.options]
version_prefix = "azure-cli-"
[backends.options.platforms.windows-arm64]
asset_pattern = "azure-cli-{{ version }}-x64.zip"
You were right that The probe workflow lived on a scratch branch in my fork and is deleted; nothing was added to this PR but the registry file. Two things it turned up that are only about the probe, not about mise: the shim re-invokes |
mise use azure-cliproduces anazthat cannot run on Windows. The tool installs fine, then:or, when some unrelated Python happens to be on PATH:
Linux and macOS are unaffected.
Why the PyPI package cannot work on Windows
azure-cli declares no
console_scriptsentry point. Its wheel carries the launchers as plain data scripts instead:entry_points.txtis absent from the dist-info, so pip and uv have nothing to generate an.exelauncher from — the one artifact that would carry the interpreter path inside it. They copyaz.batverbatim into the bin directory instead, and it resolves the interpreter next to itself:%~dp0is the directory the batch file sits in. That holds inside the venv'sScripts\and nowhere else. mise pointsUV_TOOL_BIN_DIR/PIPX_BIN_DIRat<install>/bin, a sibling of the venv rather than part of it, so theIF EXISTfails and the else branch runs whicheverpythonis on PATH.Unix escapes this because pip rewrites the
azscript's shebang to the venv interpreter at install time:A
.bathas no shebang to rewrite. That asymmetry is the whole bug: Azure/azure-cli#10516 fixed the Unix launcher this way and leftaz.baton%~dp0.Not unique to azure-cli, for what it is worth — of the 29
pipx:packages in the registry,awscli-localships the same shape (awslocal.batruns a barepython, without even theIF EXISTfallback). It has no GitHub release to switch to, so it is out of scope here.Upstream is unlikely to change it.
console_scriptswas adopted in Azure/azure-cli#1014 and reverted a week later in Azure/azure-cli#1042 ("it importspkg_resourceswhich takes a significant time of the total 'az' load time (~50%)"), then proposed again and declined in Azure/azure-cli#10900. The objection is obsolete — a wrapper generated by modern pip/uv from a wheel imports only the target module, andpkg_resourcesis not even installed in the venv — butazure/cli/__main__.pyis module-level script code with no callable to point an entry point at, so adopting one now means refactoring the telemetry and timing path. Worth raising upstream separately; not something to wait on here.Why the zip works
The official Windows zip makes no assumption about where it lives:
Purely relative, and
bin/is already where mise's defaultlist_bin_pathslooks, so nobin_pathis needed. It is also a move from a tier 3 backend to a tier 1 one for the platform that was broken, and the release carries GitHub artifact attestations and SLSA provenance, which mise verifies on install.Scope
Windows x64 only. The release carries no Linux asset, and the macOS tarball does not bundle python —
libexec/bin/azerrors withAZ_PYTHON not setoutside a Homebrew Cask path. Both keep usingpipx:, where they work today, so nothing changes for them. Windows arm64 has no asset either and still falls through topipx:.No
asset_pattern: autodetection already selects the zip over the two.msiassets on Windows, becausescore_format_preferencesgives a zip +15 there while an.msiis not an archive and scores 0 (asset_matcher.rs:591). Confirmed both bymise lock --platform windows-x64from Linux and on a real Windows machine.version_prefixis required — the tags areazure-cli-<version>:Verification
On Windows 11 x64, through the equivalent explicit backend (
github:Azure/azure-cli[version_prefix=azure-cli-]):az --version, via a shimThe
Python locationis inside the mise install directory: the bundled interpreter, with no dependency on a system Python or a pipx venv.exit 0.Shims —
mise reshimproducesaz.exe(a mise launcher, not a copy of the script) and it runs. The zip'sbin/holds exactly one file,az.cmd, so.cmd→ shim generation works. Verified by isolation: with a pipx-installed azure-cli also present,reshimproducedaz.exeandazps.exe; moving the pipx install aside left onlyaz.exe, which confirmsazps.execame from the pipxazps.ps1andaz.exefrom the zip'saz.cmd.A pinned, non-
latestversion —2.88.0resolves to theazure-cli-2.88.0tag, and installs to a directory named by the stripped version:Other checks
mise ls-remote github:Azure/azure-clireturns versions.registry-ciruns on Linux, where this entry still resolves topipx:— the existingtestis unchanged and still exercises that path. The github backend is not reachable from CI, hence the manual Windows run above.taplo fmt --checkandtaplo checkpass; the entry validates againstschema/mise-registry-tool.json.mise install azure-cli+az --versionstill works unchanged (2.89.1 via uv).One upgrade note: the install directory is keyed by the tool's short name, and the manifest records the backend that produced it, so a Windows user with an existing pipx-installed
azure-climay needmise uninstall azure-clibefore the zip is used. I could not test that transition end to end.Popularity
azure-cli-2.89.1(2026-08-12), pushed to dailyAI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: 2.1.235.
Summary by CodeRabbit