{Packaging} FIX: windows pool upgraded to 2022#33176
Conversation
❌AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
Updates the Windows CI configuration to run on a Windows Server 2022 pool and adjusts the Windows MSI build script to use the Visual Studio 2022 MSBuild location.
Changes:
- Switch Azure Pipelines
windows_poolvariable from a 2019 pool to a 2022 pool. - Update
build.cmdPATH augmentation to point to VS 2022’s MSBuild directory.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| build_scripts/windows/scripts/build.cmd | Updates MSBuild PATH entry to Visual Studio 2022 location for MSI/ZIP builds. |
| .azure-pipelines/templates/variables.yml | Moves pipeline Windows agent pool from 2019 to 2022 via shared variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo. | ||
|
|
||
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" | ||
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" |
There was a problem hiding this comment.
The VS2022 MSBuild path uses %ProgramFiles%. In a 32-bit cmd.exe context on 64-bit Windows, %ProgramFiles% typically resolves to "C:\Program Files (x86)", but VS2022 installs under the 64-bit Program Files directory, so msbuild may not be found. Use %ProgramW6432% (or an explicit 64-bit path) for the Visual Studio 2022 segment to make the script robust regardless of process bitness.
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" | |
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;%ProgramW6432%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" | ||
|
|
There was a problem hiding this comment.
The script hard-codes a single Visual Studio 2022 Enterprise MSBuild path. This will fail on machines/agents that have VS 2022 installed as Community/Professional/BuildTools (or only VS 2019), because msbuild won’t be found even though the script claims it only needs msbuild.exe on PATH. Consider resolving MSBuild dynamically (e.g., search common VS2022 install roots / BuildTools, or use where msbuild + a clear error if missing) and/or fall back to the previous VS2019 path when VS2022 isn’t present.
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" | |
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin" | |
| set "MSBUILD_BIN=" | |
| for /f "delims=" %%I in ('where msbuild.exe 2^>nul') do ( | |
| if not defined MSBUILD_BIN set "MSBUILD_BIN=%%~dpI" | |
| ) | |
| if not defined MSBUILD_BIN ( | |
| for %%V in (2022 2019) do ( | |
| for %%E in (Enterprise Professional Community BuildTools) do ( | |
| if not defined MSBUILD_BIN if exist "%ProgramFiles%\Microsoft Visual Studio\%%V\%%E\MSBuild\Current\Bin\MSBuild.exe" set "MSBUILD_BIN=%ProgramFiles%\Microsoft Visual Studio\%%V\%%E\MSBuild\Current\Bin" | |
| if not defined MSBUILD_BIN if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\%%V\%%E\MSBuild\Current\Bin\MSBuild.exe" set "MSBUILD_BIN=%ProgramFiles(x86)%\Microsoft Visual Studio\%%V\%%E\MSBuild\Current\Bin" | |
| ) | |
| ) | |
| ) | |
| if not defined MSBUILD_BIN ( | |
| echo Unable to find msbuild.exe. Please install Visual Studio Build Tools or Visual Studio, or add msbuild.exe to PATH. | |
| goto ERROR | |
| ) | |
| set "PATH=%PATH%;!MSBUILD_BIN!" |
Related command
Description
windows pool is upgraded to 2022 in the pipeline. The visual studio path is also updated to match VS 2022
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis 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.