Repository navigation
Migrate AzDO feed publishing from PAT to Entra-based auth - #17113
Conversation
When no AzureDevOpsFeedsKey is provided, the NuGet feed publisher falls back to DefaultIdentityTokenCredential for authentication. This enables using a WIF service connection instead of the dn-bot-all-orgs-artifact-feeds-rw PAT for publishing packages to AzDO feeds.
There was a problem hiding this comment.
Pull request overview
This PR updates Arcade’s AzDO feed publishing to support Entra-based authentication (via DefaultIdentityTokenCredential) when no AzureDevOpsFeedsKey is provided, enabling publishing without a PAT in compatible environments.
Changes:
- Allow AzDO NuGet publishing to fall back to Entra auth when no feed key/token is supplied.
- Adjust feed config setup to stop failing fast when an AzDO feed key is missing (log info instead).
- Update the publishing pipeline to acquire an Entra token from a WIF service connection and pass it into the publishing flow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Build.Tasks.Feed/src/model/SetupTargetFeedConfigV3.cs | Stops erroring when AzDO feed key is missing; logs and continues to allow Entra fallback. |
| src/Microsoft.DotNet.Build.Tasks.Feed/src/AzureDevOpsNugetFeedAssetPublisher.cs | Adds Entra-based Bearer auth fallback using DefaultIdentityTokenCredential when no token is provided. |
| src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishArtifactsInManifest.proj | Only emits FeedKey item when AzureDevOpsFeedsKey is non-empty to enable “missing key” detection downstream. |
| eng/publishing/v3/publish.yml | Replaces PAT usage with an Entra token retrieved via an AzureCLI task using a WIF service connection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| inputs: | ||
| azureSubscription: maestro-build-promotion |
There was a problem hiding this comment.
Are you giving this identity feed publish access?
There was a problem hiding this comment.
Yes. The dnceng-artifact-feeds-publish WIF service connection is backed by the SP dnceng-artifact-feeds-publish-wif (appId 1337244a-f109-4873-8a3d-52f406950109, objectId 8224d9dc-a3ca-448e-a7cb-846197ca3fc6), which has Contributor (push) on the target feeds:
| Feed | Project | Role |
|---|---|---|
| dotnet-eng | public | contributor |
| dotnet-tools | public | contributor |
| dotnet-eng-internal | internal | contributor |
| dotnet-tools-internal | internal | contributor |
… errors, accurate comments/log
…ck for missing feed key, validate token acquisition
Summary
When no
AzureDevOpsFeedsKeyis provided, the NuGet feed publisher now falls back toDefaultIdentityTokenCredentialfor authentication. This enables using a WIF service connection instead of thedn-bot-all-orgs-artifact-feeds-rwPAT for publishing packages to AzDO feeds.Changes
accessTokenis null/empty, useDefaultIdentityTokenCredentialto obtain a Bearer token for AzDO feed operations instead of requiring a PAT.FeedKeyMSBuild item whenAzureDevOpsFeedsKeyis non-empty, so downstream code correctly detects the absence of a key and uses Entra.dnceng-artifact-feeds-publishWIF service connection viaAzureCLI@2.Testing
AzureDevOpsFeedsKeyIS provided, behavior is unchanged (PAT-based Basic auth).Related: dnceng WI 10145 - [Packaging] PAT Migration: dn-bot-all-orgs-artifact-feeds-rw