Skip to content

Migrate DevDiv insertion token from PAT to WIF on main - #13201

Merged
davidwengier merged 1 commit into
dotnet:mainfrom
missymessa:fix/main-devdiv-insertion-wif
Jul 16, 2026
Merged

davidwengier merged 1 commit into
dotnet:mainfrom
missymessa:fix/main-devdiv-insertion-wif

Conversation

@missymessa

Copy link
Copy Markdown
Member

Ports the WIF insertion pattern (already merged to the release/* branches) to main, so the last remaining consumer of the expired DevDiv insertion PAT is removed.

Background

main's official pipeline still authenticated the DevDiv side of the VS insertion with the PAT dn-bot-devdiv-build-e-code-full-release-e-packaging-r:

  • It expired 2026-05-18 and its Key Vault secret was deleted 2026-07-11.
  • The release branches (release/dev17.14, release/dev17.12, release/stable, release/insiders) were already migrated to WIF and no longer reference it.
  • main was only partially migrated: the dnceng token uses WIF via AzureCLI@2, but --devdiv-azdo-token was still fed the PAT via variable group DotNet-Roslyn-Insertion-Variables (VG 154), whose only variable is that expired PAT.

main rarely runs the insertion stage (last official insert was 2026-05-11), so this has been latent rather than an active outage — but it blocks deletion of VG 154.

Changes

eng/pipelines/insert.yml

  • Make devDivAzdoToken optional (default: '').
  • Fall back to the WIF-acquired dnceng token for --devdiv-azdo-token when no PAT is supplied. The insertion service principal (Roslyn-Razor-Insertion-DncEng) is enrolled in both dnceng and devdiv, so a single WIF token authenticates to both orgs. This matches the roslyn-tools reference insert.yml.

azure-pipelines-official.yml

  • Remove the DotNet-Roslyn-Insertion-Variables variable group reference (only supplied the expired PAT).
  • Remove the devDivAzdoToken: $(dn-bot-devdiv-build-e-code-full-release-e-packaging-r) template argument.

The Razor.* insertion variables were already defined inline and are unaffected (confirmed against the release branches, which build and insert without this variable group).

Follow-up

After this merges and a green main official build confirms the "Insert to VS" stage authenticates to DevDiv via WIF, variable group 154 (DotNet-Roslyn-Insertion-Variables) can be deleted.

Tracked by AB#11018 (cleanup of migration AB#10089).

Ports the WIF pattern already merged to the release/* branches to main:

- insert.yml: make devDivAzdoToken optional (default '') and fall back to the
  WIF-acquired dnceng token for --devdiv-azdo-token. The insertion SP
  (Roslyn-Razor-Insertion-DncEng) is enrolled in both dnceng and devdiv, so a
  single WIF token authenticates to both orgs.
- azure-pipelines-official.yml: remove the DotNet-Roslyn-Insertion-Variables
  variable group and the devDivAzdoToken argument, both of which only supplied
  the expired PAT dn-bot-devdiv-build-e-code-full-release-e-packaging-r
  (expired 2026-05-18, KV secret deleted 2026-07-11).

This unblocks deletion of variable group 154 (its only remaining consumer).
@missymessa
missymessa requested a review from a team July 15, 2026 00:16
@missymessa

Copy link
Copy Markdown
Member Author

@missymessa

Copy link
Copy Markdown
Member Author

@davidwengier can I get your blessing on this PR and merge it, when possible? Thanks!

@davidwengier davidwengier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There should be no builds of main, and certainly no insertions from main, but I guess there is no harm in taking this, if it gets something off your TODO list. Talking with the rest of the team, there was a suggestion to delete the main branch anyway, so it really won't matter then :)

@davidwengier
davidwengier merged commit ac4fe02 into dotnet:main Jul 16, 2026
10 checks passed
@missymessa

Copy link
Copy Markdown
Member Author

@davidwengier totally fair! I don't want to blow up your pipelines when we clean up the dead PATs :)

JoeRobich added a commit that referenced this pull request Aug 18, 2026
Backports the VS insertion authentication changes from #13010 and
#13201.

Build
[3031662](https://dev.azure.com/dnceng/internal/_build/results?buildId=3031662&view=results)
failed during YAML validation because
`DotNet-Roslyn-Insertion-Variables` no longer exists. That group
supplied expired PAT credentials.

This change:
- migrates VS insertion from RIT/PAT authentication to `roslyn-tools`
with the `DncEng Insertion: Roslyn and Razor` WIF service connection
- explicitly acquires the Azure DevOps token from the WIF-authenticated
Azure CLI context
- reuses that token for both dnceng and devdiv
- removes only the obsolete `DotNet-Roslyn-Insertion-Variables`
dependency
- preserves the monthly scheduled build
- preserves the manually triggered VS insertion stage

Validation: YAML syntax parsed successfully, `git diff --check` passed,
and the release-only schedule and `trigger: manual` insertion
configuration remain present.

[Test
Run](https://dev.azure.com/dnceng/internal/_build/results?buildId=3049433&view=results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants