Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Replace dn-bot-dnceng-build-rw-code-rw PAT with WIF service connection in mirror-within-azdo - #66074

#66074
Merged
missymessa merged 3 commits into
maindotnet/aspnetcore:mainfrom
pat-migration/wif-mirror-within-azdodotnet/aspnetcore:pat-migration/wif-mirror-within-azdoCopy head branch name to clipboard
Apr 2, 2026
Merged

Replace dn-bot-dnceng-build-rw-code-rw PAT with WIF service connection in mirror-within-azdo#66074
missymessa merged 3 commits into
maindotnet/aspnetcore:mainfrom
pat-migration/wif-mirror-within-azdodotnet/aspnetcore:pat-migration/wif-mirror-within-azdoCopy head branch name to clipboard

Conversation

@missymessa

Copy link
Copy Markdown
Member

Summary

Migrate the \�zure-pipelines-mirror-within-azdo.yml\ pipeline from using the \dn-bot-dnceng-build-rw-code-rw\ PAT (from the \Mirror-Credentials\ variable group) to the \dnceng-build-rw-code-rw-wif\ Workload Identity Federation service connection.

Changes

  • New \AzureCLI@2\ step – mints an AzDO bearer token via \�z account get-access-token\ using the \dnceng-build-rw-code-rw-wif\ WIF service connection and stores it as the secret pipeline variable \WifAzdoToken.
  • Clone step now uses \\ instead of \\ in the git URL.

Why this works

The clone URL uses basic-auth format \https://dn-bot:@dev.azure.com/.... AzDO accepts bearer tokens as the password in basic auth with any username, so this is a drop-in replacement. The subsequent \git push\ inherits the credentials from the clone.

Pipeline

  • dotnet-aspnetcore-merge-to-nonstable-branch (Definition ID: 1148, dnceng/internal)
  • Triggers on \internal/release/8.0\ and
    elease/10.0\ branches

Related

  • Part of PAT migration work item WI 10139
  • Service connection: \dnceng-build-rw-code-rw-wif\ (Entra app \ 21f66e0-bb35-4fd3-bc70-ba084d1e7a52)

Migrate the mirror-within-azdo pipeline from using the
dn-bot-dnceng-build-rw-code-rw PAT (from the Mirror-Credentials
variable group) to the dnceng-build-rw-code-rw-wif Workload Identity
Federation service connection.

A new AzureCLI@2 step mints an AzDO bearer token via
az account get-access-token and stores it as WifAzdoToken.
The git clone step now uses this token instead of the PAT.

Part of: PAT Migration WI 10139
@missymessa
missymessa requested review from a team and wtgodbe as code owners March 30, 2026 22:28
Copilot AI review requested due to automatic review settings March 30, 2026 22:28
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 30, 2026
@missymessa

Copy link
Copy Markdown
Member Author

@wtgodbe let me know how I can best test this change!

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

Migrates the azure-pipelines-mirror-within-azdo.yml pipeline from using a long-lived PAT to using a WIF-backed service connection to mint an Azure DevOps access token for intra-AzDO mirroring.

Changes:

  • Adds an AzureCLI@2 step that mints an Azure DevOps AAD access token and stores it as a secret pipeline variable (WifAzdoToken).
  • Updates the git clone URL to use the minted token instead of the dn-bot-dnceng-build-rw-code-rw PAT.

Comment thread .azure/pipelines/azure-pipelines-mirror-within-azdo.yml
Comment thread .azure/pipelines/azure-pipelines-mirror-within-azdo.yml Outdated
Comment thread .azure/pipelines/azure-pipelines-mirror-within-azdo.yml Outdated
missymessa and others added 2 commits April 1, 2026 16:23
…used variable group

- Extract Azure DevOps resource ID to named variable with comment
- Add error handling for token acquisition (exit code + empty check)
- Use git -c http.extraheader for clone/push instead of embedding
  token in the URL (avoids persisting credential in .git/config)
- Remove Mirror-Credentials variable group (no longer needed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.