Skip to content

Migrate AzDO feed publishing from PAT to Entra-based auth - #17113

Merged
missymessa merged 8 commits into
dotnet:mainfrom
missymessa:migrate-feed-publish-to-entra
Jul 17, 2026
Merged

missymessa merged 8 commits into
dotnet:mainfrom
missymessa:migrate-feed-publish-to-entra

Conversation

@missymessa

@missymessa missymessa commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

When no AzureDevOpsFeedsKey is provided, the NuGet feed publisher now 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.

Changes

  1. AzureDevOpsNugetFeedAssetPublisher.cs: When accessToken is null/empty, use DefaultIdentityTokenCredential to obtain a Bearer token for AzDO feed operations instead of requiring a PAT.
  2. SetupTargetFeedConfigV3.cs: When no feed key is found for an AzDo NuGet feed, log an informational message instead of erroring out. The publisher falls back to Entra-based auth.
  3. PublishArtifactsInManifest.proj: Only include the FeedKey MSBuild item when AzureDevOpsFeedsKey is non-empty, so downstream code correctly detects the absence of a key and uses Entra.
  4. eng/publishing/v3/publish.yml: Replace the PAT with an Entra token obtained from the dnceng-artifact-feeds-publish WIF service connection via AzureCLI@2.

Testing

  • Backward compatible: when AzureDevOpsFeedsKey IS provided, behavior is unchanged (PAT-based Basic auth).
  • New path: when key is empty/absent, an Entra token is acquired and used as Bearer auth.
  • AzDO NuGet feeds accept both Basic (PAT) and Bearer (Entra) auth.

Related: dnceng WI 10145 - [Packaging] PAT Migration: dn-bot-all-orgs-artifact-feeds-rw

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.
Copilot AI review requested due to automatic review settings July 13, 2026 21:54

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

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.

Comment thread eng/publishing/v3/publish.yml Resolved
@missymessa
missymessa marked this pull request as ready for review July 13, 2026 22:14
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
azureSubscription: maestro-build-promotion

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.

Are you giving this identity feed publish access?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copilot AI review requested due to automatic review settings July 15, 2026 14:52

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 15:07

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Comment thread eng/publishing/v3/publish.yml Resolved
Copilot AI review requested due to automatic review settings July 15, 2026 15:22

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread eng/publishing/v3/publish.yml Resolved
Copilot AI review requested due to automatic review settings July 15, 2026 17:01

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

…ck for missing feed key, validate token acquisition
Copilot AI review requested due to automatic review settings July 15, 2026 18:13

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 16, 2026 13:26

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@missymessa
missymessa enabled auto-merge (squash) July 16, 2026 15:00
Copilot AI review requested due to automatic review settings July 16, 2026 18:22

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@missymessa
missymessa merged commit 7fbf42f into dotnet:main Jul 17, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 18, 2026
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.

3 participants