Migrate dn-bot-devdiv-drop-rw-code-rw PAT to WIF service connection#15792
Conversation
Replace the dn-bot-devdiv-drop-rw-code-rw PAT with a WIF-based service connection (dnceng-devdiv-drop-rw-code-rw-wif) for DevDiv drop access. - Add AzureCLI@2 task to acquire an Entra token via the WIF SC - Set _DevDivDropAccessToken at runtime via the WIF token - Remove static PAT variable reference from DotNet-VSTS-Infra-Access
There was a problem hiding this comment.
Pull request overview
This PR migrates DevDiv drop publishing in the official Azure Pipelines build from a static PAT (dn-bot-devdiv-drop-rw-code-rw) to a WIF-based service connection, acquiring an Entra ID access token at runtime before the VSTS drop upload task.
Changes:
- Replaced the
_DevDivDropAccessTokenvariable’s static PAT value with an empty placeholder to be populated at runtime. - Added an
AzureCLI@2step in the Publish job to acquire an Azure DevOps access token via thednceng-devdiv-drop-rw-code-rw-wifservice connection. - Continued passing
_DevDivDropAccessTokeninto1ES.MicroBuildVstsDrop@1for drop upload, now sourced from the WIF-acquired token.
| - group: DotNet-Symbol-Server-Pats | ||
| # Group gives access to $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw | ||
| - group: DotNet-VSTS-Infra-Access | ||
| # DevDiv drop access token is acquired via WIF service connection (dnceng-devdiv-drop-rw-code-rw-wif) | ||
| - name: _DevDivDropAccessToken | ||
| value: $(dn-bot-devdiv-drop-rw-code-rw) | ||
| value: '' |
| scriptType: pscore | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| $token = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv |
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
Thanks for looking at this @nohwnd! The pipeline trigger exclusion is expected — the PR validation YAML on the Important: Even if PR validation runs, it will execute the old YAML from Context on why this is safe:
If you'd like a manual test build before merge, I can queue one from the |
Summary
Replaces the \dn-bot-devdiv-drop-rw-code-rw\ PAT with a WIF-based service connection (\dnceng-devdiv-drop-rw-code-rw-wif) for DevDiv drop access.
Changes
Context
This is part of the PAT-to-Entra migration tracked by AB#10146. The WIF service connection \dnceng-devdiv-drop-rw-code-rw-wif\ (backed by app registration \dnceng-devdiv-drop-rw-code-rw-wif, App ID: \7106a410-fbcb-4750-a202-879077f925ec) was previously created and verified. The same pattern was successfully deployed in dotnet/fsharp#19598.
Validation