Skip to content

Fix production channel validation authentication - #17435

Merged
akoeplinger merged 1 commit into
mainfrom
akoeplinger/fix-production-channel-validation-auth
Aug 30, 2026
Merged

akoeplinger merged 1 commit into
mainfrom
akoeplinger/fix-production-channel-validation-auth

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

Summary

  • use DefaultIdentityTokenCredential for Azure DevOps build metadata when no explicit AzdoApiToken is supplied
  • use SYSTEM_ACCESSTOKEN as the fallback credential for the branch classification API, matching 1ES Pipeline Templates
  • preserve explicit PAT and Entra token support for Azure DevOps API calls

Context

#16892 removed the broad dn-bot-all-orgs-build-rw-code-rw PAT from Build Promotion and relied on the established federated Entra fallback. Production channel validation used separate HTTP services that did not adopt that fallback, so the Azure DevOps build lookup was unauthenticated and attempted to deserialize the returned sign-in HTML as JSON.

The Azure DevOps lookup now follows the same federated credential pattern as artifact publishing. Branch classification continues to use the Azure Pipelines job token, matching the implementation in 1ES Pipeline Templates.

Validation

dotnet test src/Microsoft.DotNet.Build.Tasks.Feed.Tests/Microsoft.DotNet.Build.Tasks.Feed.Tests.csproj --no-restore --filter 'FullyQualifiedName~ProductionChannelValidatorTests|FullyQualifiedName~PublishArtifactsInManifestTests|FullyQualifiedName~AzdoAuthHeaderTests' --verbosity minimal

Use the federated Azure DevOps credential fallback for build metadata lookups and the pipeline job token for branch classification.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 6443e32b-f4fc-4315-a3fc-9b9a58d74e17
Copilot AI lite review requested due to automatic review settings August 28, 2026 11:23
@akoeplinger
akoeplinger requested a review from missymessa August 28, 2026 11:25

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

Updates Production Channel Validation’s Azure DevOps authentication so build-metadata lookups are authenticated even when no explicit AzdoApiToken is provided, aligning with the repo’s broader PAT-to-Entra/WIF fallback approach and the 1ES pipeline token pattern for branch classification.

Changes:

  • Switch Azure DevOps build metadata calls to use DefaultIdentityTokenCredential (Entra/WIF/MI) when AzdoApiToken is not provided, while preserving explicit token support via GeneralUtils.CreateAzdoAuthHeader.
  • Use SYSTEM_ACCESSTOKEN as the fallback token for the Branch Classification API.
  • Wire ManagedIdentityClientId into the DI-created AzureDevOpsService.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifest.cs Passes ManagedIdentityClientId into the Azure DevOps build-info service registration so it can use MI/WIF fallback when no PAT is supplied.
src/Microsoft.DotNet.Build.Tasks.Feed/src/ProductionChannelValidator.cs Implements per-request Azure DevOps auth (PAT/JWT via CreateAzdoAuthHeader, else Entra via DefaultIdentityTokenCredential) and adds SYSTEM_ACCESSTOKEN fallback for branch classification.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@missymessa missymessa 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.

LGTM shipit

@akoeplinger
akoeplinger enabled auto-merge (squash) August 28, 2026 17:30
@akoeplinger
akoeplinger merged commit 5403b94 into main Aug 30, 2026
11 of 13 checks passed
@akoeplinger
akoeplinger deleted the akoeplinger/fix-production-channel-validation-auth branch August 30, 2026 19:07
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 31, 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