Skip to content

Use build identity (System.AccessToken) for internal feed creds instead of expired dn-bot-dnceng-artifact-feeds-rw PAT (release/8.0) - #67854

Merged
wtgodbe merged 2 commits into
release/8.0from
missymessa/release-8.0-internal-feeds-build-identity
Jul 16, 2026
Merged

Use build identity (System.AccessToken) for internal feed creds instead of expired dn-bot-dnceng-artifact-feeds-rw PAT (release/8.0)#67854
wtgodbe merged 2 commits into
release/8.0from
missymessa/release-8.0-internal-feeds-build-identity

Conversation

@missymessa

@missymessa missymessa commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Internal official builds fail restore with HTTP 401 on darc-int-* / dotnet-*-internal feeds because dn-bot-dnceng-artifact-feeds-rw was removed from the arcade secret manifest (arcade #17079) and expired 2026-07-11.

Change

The 8.0 SetupNugetSources.ps1 has a mandatory -Password, and it is also the step that re-enables the darc-int sources (which ship disabled in NuGet.config via <disabledPackageSources>). So dropping it and relying on NuGetAuthenticate@1 alone would not work — the sources would stay disabled. Instead this keeps the Setup Private Feeds Credentials task and swaps the credential from the dead PAT to the pipeline's build-service OAuth token $(System.AccessToken).

$(System.AccessToken) is the dnceng/internal Project Build Service identity, which has read access to all affected feeds — this is the intended "build identity instead of PAT" migration for feeds hosted in the same AzDO org.

Validation

  • SetupNugetSources still enables the disabled darc-int sources.
  • Build-service identity has ≥reader on darc-int-* / dotnet-*-internal.

Tracking: dnceng/internal AB#11679.

missymessa and others added 2 commits July 16, 2026 12:21
…expired dn-bot-dnceng-artifact-feeds-rw PAT

Replaces the SetupNugetSources PAT-credential steps with NuGetAuthenticate@1.
The PAT expired 2026-07-11 (removed from arcade secret manifest, PR #17079),
causing 401s on darc-int-* and dotnet-*-internal feeds. The build service
identity has read access to these feeds; feed sources are already in NuGet.config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 331a413c-8b88-448e-8913-6ca49130a046
…ad of expired dn-bot-dnceng-artifact-feeds-rw PAT

Keeps SetupNugetSources (which re-enables the disabled darc-int sources) and
feeds it the pipeline build-service OAuth token instead of the decommissioned PAT.
The PAT expired 2026-07-11 (removed from arcade manifest, PR #17079).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 331a413c-8b88-448e-8913-6ca49130a046
@missymessa missymessa changed the title Use NuGetAuthenticate (build identity) for internal feeds instead of expired dn-bot-dnceng-artifact-feeds-rw PAT (release/8.0) Use build identity (System.AccessToken) for internal feed creds instead of expired dn-bot-dnceng-artifact-feeds-rw PAT (release/8.0) Jul 16, 2026
@missymessa
missymessa marked this pull request as ready for review July 16, 2026 19:47
@missymessa
missymessa requested review from a team and wtgodbe as code owners July 16, 2026 19:47
Copilot AI review requested due to automatic review settings July 16, 2026 19:47

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.

Pull request overview

Updates the internal build pipeline to authenticate to Azure DevOps internal NuGet feeds using the build’s OAuth identity token ($(System.AccessToken)) instead of the expired dn-bot-dnceng-artifact-feeds-rw PAT, while keeping the SetupNugetSources step that re-enables disabled darc-int-* sources in NuGet.config.

Changes:

  • Switch Setup Private Feeds Credentials (PowerShell/Bash) to pass $(System.AccessToken) into SetupNugetSources for feed credentials.
  • Preserve the SetupNugetSources invocation so darc-int-* sources remain enabled for restores.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 416 to +420
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
Token: $(System.AccessToken)
@wtgodbe

wtgodbe commented Jul 16, 2026

Copy link
Copy Markdown
Member

Merging to unblock internal builds

@wtgodbe wtgodbe added the tell-mode Indicates a PR which is being merged during tell-mode label Jul 16, 2026
@wtgodbe
wtgodbe merged commit 330ef7e into release/8.0 Jul 16, 2026
11 of 26 checks passed
@wtgodbe
wtgodbe deleted the missymessa/release-8.0-internal-feeds-build-identity branch July 16, 2026 20:20
missymessa added a commit that referenced this pull request Jul 16, 2026
Removing the credential entirely (relying only on NuGetAuthenticate) is insufficient because the Arcade toolset bootstrap restore reads credentials directly from NuGet.config. Pass the build identity OAuth token via legacyCredential so SetupNugetSources writes it to NuGet.config. Matches release/8.0 (#67854).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 331a413c-8b88-448e-8913-6ca49130a046
wtgodbe pushed a commit that referenced this pull request Jul 16, 2026
* Use System.AccessToken for internal feed auth on release/9.0

Removing the credential entirely (relying only on NuGetAuthenticate) is insufficient because the Arcade toolset bootstrap restore reads credentials directly from NuGet.config. Pass the build identity OAuth token via legacyCredential so SetupNugetSources writes it to NuGet.config. Matches release/8.0 (#67854).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 331a413c-8b88-448e-8913-6ca49130a046

* Only pass legacyCredential when System.TeamProject == internal

Avoids forcing the enable-internal-sources template down the legacy PAT path for non-internal (e.g. DevDiv) projects, preserving the federated service-connection auth flow there. Addresses Copilot review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 331a413c-8b88-448e-8913-6ca49130a046

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tell-mode Indicates a PR which is being merged during tell-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants