azdo-pipelines: bootstrap pnpm from proxy feed instead of Corepack#2365
Merged
Conversation
Corepack downloads the pnpm binary from registry.npmjs.org before any feed auth/.npmrc is applied, which fails on network-restricted AzDO agents that cannot reach that host. Install the pinned pnpm (from package.json's "packageManager" field) via `npm install -g` from an anonymous proxy feed instead -- npm fetches only the packument + tarball, both served by the proxy. The proxy feed is hardcoded for now; it can be parametrized later if a consumer needs a different one. Consumers keep a clean "packageManager": "pnpm@<version>" pin. The GHA reusable workflow stays on Corepack (GitHub-hosted runners reach registry.npmjs.org). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f99691c9-7434-40cc-b04d-fdc697586b45
alexweininger
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pnpm builds on network-restricted Azure DevOps agents fail at the "👉 Activate pnpm" step. Corepack downloads the pnpm binary from
registry.npmjs.orgbefore any feed auth /.npmrcis applied, and those agents cannot reach that host (hard network block, EPERM).Fix
In
azdo-pipelines/templates/setup.yml, install the pinned pnpm vianpm install -g pnpm@<version>from an anonymous proxy feed (https://packagefeedproxy.microsoft.io/npm) instead of Corepack. npm fetches only the packument + tarball, both of which the proxy serves (verified: packument and tarball return 200; the per-version manifest endpoint thatCOREPACK_NPM_REGISTRYneeds returns 404, which is why the Corepack env-var route does not work with this feed).package.json'spackageManagerfield (pnpm@11.8.0orpnpm@11.8.0+sha512...→ bare version), so consumers keep a clean"packageManager": "pnpm@<version>"— no tarball URLs or extra env vars.corepack disable pnpmruns first so a stale Corepack shim can't shadow the freshly installed global pnpm on PATH.The
packageManager: pnpmdoc comment in1es-mb-main.ymland the "Using pnpm" section inazdo-pipelines/README.mdare updated to match.Scope
.github/workflows/jobs.yml) is unchanged — it stays on Corepack. GitHub-hosted runners reachregistry.npmjs.org, and once a consumer reverts to a clean pin its GHA works via Corepack. The (possibly network-scoped) proxy is deliberately not baked into the public-runner path.ref: azext-pt/v1, which is advanced to this commit separately (via the fast-forward GHA) after merge.Consumer follow-up (e.g.
vscode-containers)Once this lands and
azext-pt/v1is advanced:package.jsonpackageManagerto a cleanpnpm@11.8.0(drop the proxy tarball URL +#sha512integrity form).COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1AzDO pipeline variable.Validation
azext-pt/v1is advanced.