Skip to content

AOT 6: Validate authentication scenarios and publishing in both reference modes - #4817

Draft
paulmedynski wants to merge 6 commits into
dev/paul/aot/phase-1.5from
dev/paul/aot/phase-1.6
Draft

paulmedynski wants to merge 6 commits into
dev/paul/aot/phase-1.5from
dev/paul/aot/phase-1.6

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Integrate authentication compatibility scenarios and trimmed/NativeAOT publishing checks into build orchestration and Linux/Windows CI.

Why?

Authentication behavior must remain consistent across project and package references, supported runtimes, and publishing modes. Executable, isolated consumers verify configuration activation, provider precedence, recovery, and published applications rather than compilation alone.

How

  • Exercise current/legacy configuration, provider precedence, recoverable invalid-provider/initializer/unsupported-provider entries, one-time failure diagnostics, and disabled switches.
  • Verify recoverable configuration failures do not prevent enabled Azure discovery or explicit registration, and failed configuration entries are not retried.
  • Support Project and Package references with local package preparation, distinct family versions, and isolated NuGet caches.
  • Publish and execute trimmed and NativeAOT Linux consumers with compiler/linker warnings treated as errors, checking that Azure discovery assets are absent and explicit registration succeeds.
  • Add aggregate scenario and build-only targets, include fixtures in standard test builds, and cover orchestration arguments.
  • Add independent Linux modern/publishing and Windows .NET Framework CI jobs for both reference modes, and document execution prerequisites.
  • Keep runtime-family enforcement and its replacement-driver fixture/scenarios out of this PR; they now belong together in final layer AOT 7: Enforce exact loaded authentication family versions #4820.
  • PR validation: trigger Linux Project/Package scenario, trimmed, and NativeAOT runs.
  • PR validation: trigger Windows .NET Framework Project/Package scenario runs.

Stack order

AOT 6, after replacement localization PR #4942 and before #4820. This layer is independently valid without runtime family-version enforcement.

The commits and PR bases follow this order in native stack #4943.

Issues

Completes the NativeAOT authentication fix for #4193. Optional runtime-family enforcement follows separately in #4820.

Testing

  • dotnet build build.proj -t:TestAuthentication -p:ReferenceType=Project -p:Configuration=Release -p:TestFramework=net10.0 -p:AuthenticationPublish=true -v:minimal - passed: six configuration scenarios, trimmed execution, and NativeAOT execution.
  • NUGET_PACKAGES=<isolated-cache> dotnet build build.proj -t:TestAuthentication -p:ReferenceType=Package -p:Configuration=Release -p:TestFramework=net10.0 -p:AuthenticationPublish=true -p:PackageVersionSqlClient=8.0.0-stack.6pkg -v:minimal - passed: six configuration scenarios, trimmed execution, and NativeAOT execution using locally built packages.
  • dotnet build build.proj -t:BuildAuthenticationTests -p:ReferenceType=Project -p:Configuration=Debug -p:TestFramework=net462 -v:minimal - passed: .NET Framework fixture compilation; this is not Windows runtime execution.
  • pwsh -NoProfile -NonInteractive -Command '$r = Invoke-Pester -Path ./eng/pipelines/scripts/tests/Build-Orchestration.Tests.ps1,./eng/pipelines/scripts/tests/Pipeline-Arguments.Tests.ps1 -PassThru; if ($r.FailedCount -gt 0 -or $r.PassedCount -eq 0) { exit 1 }' - passed: 123 tests.
  • Corrected stale configuration-handler casts, configuration-failure expectations, and the Abstractions target-framework matrix exposed by rebasing onto the current prerequisites.
  • Package-mode restore reported two credential-provider cache warnings; compilation, scenarios, and both publishes succeeded.
  • Windows/.NET Framework runtime execution was not run on this Linux host. Full ADO pipeline runs remain pending.

Guidelines

Please review the contribution guidelines before submitting a pull request:

Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:24
@paulmedynski
paulmedynski added this pull request to stack #4822 October 9, 2026 18: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.

🔵 Needs a closer look

Cross-platform pipeline and NativeAOT changes are substantial, while Windows CLR and remote CI execution remain unverified.

0 open findings

What changed in this PR

Adds a dedicated authentication validation harness covering configuration, package/reference modes, runtime mismatches, and trimmed/NativeAOT publishing.

Changes:

  • Expands fresh-process authentication scenarios and package-source validation.
  • Adds trim/AOT publishing checks and build orchestration.
  • Introduces Linux and Windows CI coverage for Project and Package modes.

No actionable defects were identified by inspection. Existing review threads were not provided.

File Description
RunAuthenticationTests.ps1 Orchestrates scenarios, package checks, and publishing.
AuthenticationTests/​README.md Documents harness usage and prerequisites.
PublishTest/​PublishTest.csproj Configures trim/AOT fixture references.
PublishTest/​Program.cs Validates trimmed authentication registration.
ConfigurationTest/​Program.cs Expands configuration and failure scenarios.
ConfigurationTest/​ConfigurationTest.csproj Adds Azure references.
bad-unsupported.config Adds unsupported-provider scenario.
bad-provider.config Adds missing-provider scenario.
bad-initializer.config Adds missing-initializer scenario.
Microsoft.Data.SqlClient.slnx Includes the publishing fixture.
Pipeline-Arguments.Tests.ps1 Checks the authentication CI matrix.
Build-Orchestration.Tests.ps1 Verifies harness orchestration and references.
authentication-validation-stage.yml Adds cross-platform authentication jobs.
dotnet-sqlclient-ci-core.yml Integrates the new CI stage.
BUILDGUIDE.md Documents targets and publishing commands.
build.proj Adds complete and build-only authentication targets.
testing.instructions.md Records authentication fixture conventions.

🧠 Review effort: Balanced


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

@paulmedynski paulmedynski added the Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity. label Oct 13, 2026
@paulmedynski paulmedynski added this to the 8.0.0-preview1 milestone Oct 13, 2026
@paulmedynski paulmedynski changed the title Validate authentication scenarios and publishing in both reference modes AOT 6: Validate authentication scenarios and publishing in both reference modes Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 17:41
@paulmedynski
paulmedynski removed this pull request from stack #4822 October 13, 2026 17:44
@paulmedynski
paulmedynski added this pull request to stack #4839 October 13, 2026 17:45

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.

🟡 Changes recommended

BuildTests includes authentication fixtures but silently omits their declared net462 target unless explicitly requested.

1 open finding

🧠 Review effort: Balanced

Comment thread build.proj
@paulmedynski paulmedynski changed the title AOT 6: Validate authentication scenarios and publishing in both reference modes AOT 7: Validate authentication scenarios and publishing in both reference modes Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 14, 2026 11:36
@paulmedynski
paulmedynski force-pushed the dev/paul/aot/phase-1.6 branch from 7c3e459 to 02d0134 Compare October 14, 2026 11:36
@paulmedynski
paulmedynski removed this pull request from stack #4839 October 14, 2026 11:39
@paulmedynski paulmedynski changed the title AOT 7: Validate authentication scenarios and publishing in both reference modes AOT 5: Validate authentication scenarios and publishing in both reference modes Oct 14, 2026
@paulmedynski
paulmedynski added this pull request to stack #4841 October 14, 2026 11:40

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.

🔵 Needs a closer look

The new cross-platform package and NativeAOT CI paths have not yet been compiled or executed remotely, including Windows CLR coverage.

1 open finding

🧠 Review effort: Balanced

paulmedynski added a commit that referenced this pull request Oct 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Oct 14, 2026
paulmedynski added a commit that referenced this pull request Oct 16, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🔵 Needs a closer look

Verified Linux trimmed/NativeAOT and Windows .NET Framework execution results are still needed for both reference modes.

2 open issues

Review effort: Balanced

paulmedynski added a commit that referenced this pull request Oct 20, 2026
- Defer executable authentication compatibility tests from #4816 to #4817
- Correct WAM expansion in authentication configuration docs (#4816)
- Clarify authentication configuration handlers are infrastructure types
paulmedynski added a commit that referenced this pull request Oct 22, 2026
- Defer executable authentication compatibility tests from #4816 to #4817
- Correct WAM expansion in authentication configuration docs (#4816)
- Clarify authentication configuration handlers are infrastructure types
paulmedynski added a commit that referenced this pull request Oct 23, 2026
…#4816)

* - Expose authentication configuration handlers from Abstractions
- Defer executable authentication compatibility tests from #4816 to #4817
- Correct WAM expansion in authentication configuration docs (#4816)
- Clarify authentication configuration handlers are infrastructure types

* Address authentication configuration review feedback (#4816)

Use framework configuration in the net462 Abstractions target.
Expose sealed sibling handlers with separate source and XML documentation.
Keep driver configuration normalization as a temporary bridge to #4821.
Cover real legacy/current configuration activation and preserved reader behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
paulmedynski added a commit that referenced this pull request Oct 29, 2026
- Describe runtime validation in authentication bootstrap documentation
- Decouple authentication guidance from consumer version enforcement
- Defer the executable runtime-version fixture to #4817
paulmedynski and others added 4 commits October 29, 2026 10:25
Preserve the final scenario harness, publishing checks, CI wiring and orchestration tests from the original #4817 layer while dropping obsolete intermediate fixture deferrals during restacking.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Relocate runtime-version fixtures and orchestration to the final PR #4820. Align configuration scenarios and framework expectations with the rebased registry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…fixture

Keep the independently buildable #4817 fixture compatible with .NET Framework after rebasing the stack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the inherited deferral note now that this stack layer supplies the executable scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
paulmedynski added a commit that referenced this pull request Oct 29, 2026
- Describe runtime validation in authentication bootstrap documentation
- Decouple authentication guidance from consumer version enforcement
- Defer the executable runtime-version fixture to #4817
@paulmedynski
paulmedynski force-pushed the dev/paul/aot/phase-1.6 branch from b8c7e0c to f6637e5 Compare October 29, 2026 14:02
Base automatically changed from dev/paul/aot/phase-1.5 to main October 29, 2026 14:02
@paulmedynski paulmedynski changed the title AOT 7: Validate authentication scenarios and publishing in both reference modes AOT 6: Validate authentication scenarios and publishing in both reference modes Oct 29, 2026
@paulmedynski
paulmedynski removed this pull request from stack #4861 October 29, 2026 14:13
@paulmedynski
paulmedynski changed the base branch from main to dev/paul/aot/phase-1.5 October 29, 2026 14:13
@paulmedynski
paulmedynski added this pull request to stack #4943 October 29, 2026 14:13
@paulmedynski paulmedynski added the Area\Tests Issues that are targeted to tests or test projects label Oct 29, 2026
@paulmedynski paulmedynski modified the milestone: 8.0.0-preview1 Oct 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

The net462 configuration replacement discards generated assembly-binding redirects, causing provider activation to fail when a dependency needs a redirect rather than testing authentication behavior.

3 open issues

Review effort: Balanced

Comment thread src/Microsoft.Data.SqlClient/tests/AuthenticationTests/RunAuthenticationTests.ps1 Outdated
Build both authentication frameworks by default, normalize cross-platform
path assertions, and preserve generated runtime configuration across scenarios.
Add regression coverage and update authentication harness documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🔵 Needs a closer look

Pending CI runs leave Windows net462 assembly-binding behavior and Linux trimmed/NativeAOT authentication execution unvalidated in both reference modes.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity. Area\Tests Issues that are targeted to tests or test projects

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Entra ID authentication broken under NativeAOT in v7.0 — Extensions.Azure reflection-based discovery is AOT-incompatible

4 participants