Skip to content

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Jan 22, 2026

Description

This PR ties everything together:

  • Removes Azure authentication files from the MDS projects.
  • Adds dependencies to the Abstractions package everywhere necessary.
  • Updates pipelines to include Abstractions and Azure packages where necessary.
  • Removed some unnecessary flexibility in the MDS official pipeline.

PR series:

Testing

  • Normal PR/CI pipeline runs will validate most changes.
  • Manual inspection of pipeline logs and artifacts will confirm some of the fiddly parts.

@paulmedynski paulmedynski added this to the 7.0.0-preview4 milestone Jan 22, 2026
@paulmedynski paulmedynski added the Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity. label Jan 22, 2026
Copilot AI review requested due to automatic review settings January 22, 2026 15:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request is the third step in the Azure Split work, which removes Azure authentication implementation from the main SqlClient project and establishes dependencies on the new Abstractions package. The PR removes Azure-specific authentication code, updates project dependencies, adds test authentication providers, and updates CI/CD pipelines to handle the new package structure.

Changes:

  • Removes ActiveDirectoryAuthenticationProvider, SqlAuthenticationProvider, SqlAuthenticationToken, SqlAuthenticationParameters, and related Azure authentication classes from the MDS source
  • Adds dependency on Microsoft.Data.SqlClient.Extensions.Abstractions package across all MDS projects (src and ref)
  • Updates test infrastructure with UsernamePasswordProvider and ManagedIdentityProvider implementations for manual tests
  • Updates all pipeline YAML files to include AbstractionsPackageVersion parameter and propagate it through build and test steps

Reviewed changes

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

Show a summary per file
File Description
tools/specs/Microsoft.Data.SqlClient.nuspec Adds Abstractions package dependency to all target frameworks
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs Implements dynamic loading of Azure extension package as default provider
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs Refactors token acquisition retry logic to use new exception model
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/*.cs Adds test authentication providers
src/Microsoft.Data.SqlClient/**/Microsoft.Data.SqlClient.csproj Removes Azure.* package references, adds Abstractions reference
eng/pipelines/**/*.yml Adds AbstractionsPackageVersion parameter throughout

Copilot AI review requested due to automatic review settings January 22, 2026 16:26
Copy link
Contributor

Copilot AI left a comment

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 45 out of 45 changed files in this pull request and generated no new comments.

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 51.81347% with 93 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.41%. Comparing base (30140f6) to head (25590be).

Files with missing lines Patch % Lines
...Data/SqlClient/SqlAuthenticationProviderManager.cs 43.39% 60 Missing ⚠️
...Data/SqlClient/Connection/SqlConnectionInternal.cs 51.61% 15 Missing ⚠️
...ta/SqlClient/SqlAuthenticationParametersBuilder.cs 77.55% 11 Missing ⚠️
...SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           dev/paul/azure/step2    #3908      +/-   ##
========================================================
- Coverage                 67.54%   67.41%   -0.14%     
========================================================
  Files                       263      260       -3     
  Lines                     66190    65691     -499     
========================================================
- Hits                      44710    44284     -426     
+ Misses                    21480    21407      -73     
Flag Coverage Δ
netcore 67.48% <48.70%> (-0.07%) ⬇️
netfx 66.38% <51.81%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski marked this pull request as ready for review January 26, 2026 15:41
@paulmedynski paulmedynski requested a review from a team as a code owner January 26, 2026 15:41
Copilot AI review requested due to automatic review settings January 26, 2026 15:41
@paulmedynski paulmedynski changed the title [Draft] Azure Split - Step 3 - Tie Everything Together Azure Split - Step 3 - Tie Everything Together Jan 26, 2026
Copy link
Contributor

Copilot AI left a comment

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 51 out of 51 changed files in this pull request and generated 2 comments.

@priyankatiwari08 priyankatiwari08 self-assigned this Feb 2, 2026
Base automatically changed from dev/paul/azure/step2 to main February 2, 2026 19:32
…ogether

- Brought over all of the remaining code and project changes.
…ogether

- Brought over the pipeline changes.
- Removed unnecessary flexibility from the MDS official pipeline tree.
…ogether

- Removed Azure parameters from CI test tree.
…ogether

- Fixed missing Abstractions and MDS package version parameters.
…ogether

- Re-activate the Azure tests.
- Address PR comments.
…ogether

- Addressed a few final comments from the Step 2 PR.
Copilot AI review requested due to automatic review settings February 2, 2026 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this file (and its netfx equivalent) is generic enough that I wouldn't expect it to be locked down to Release and Package. I'm ok with this change, but would like to change the file names to better set expectations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally these are going to be blown away with the new pipeline, post this and common mds project work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The official templates and CI/PR templates are all mushed together. I've been adding comments to the tops of the official ones to help us out until we can create the new pipelines, which IMO should have their own directories to keep things obviously separate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise, this file is package ref specific, but the name doesn't convey that.

dependsOn:
- build_abstractions_package_stage
- build_mds_akv_packages_stage
dotnetVerbosity: diagnostic
Copy link
Contributor

Choose a reason for hiding this comment

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

Set back to normal?

benrr101
benrr101 previously approved these changes Feb 3, 2026
Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Overall looks good to me 🚢

build.proj Outdated
$(DotnetPath)dotnet test "@(UnitTestsProj)"
-f $(TF)
-p:Configuration=$(Configuration)
-p:ReferenceType=Project
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems a bit unnecessary/misleading to me to have this - the unit test csproj doesn't pay any attention to the reference type, unless there's some magic junk going on in the directory.build.props (and if there is, we should remove it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of those times that the absence of ReferenceType looks weird (because it is needed everywhere else), and its presence looks weird (if you know that UnitTests doesn't explicitly need it). The src/Directory.Build.props does use it, but it applies a default of Project, so you're correct that it isn't strictly needed here. I will remove this and add a comment explaining why it is absent.

-p:Configuration=$(Configuration)
-p:ReferenceType=$(ReferenceType)
-p:AbstractionsPackageVersion=$(AbstractionsPackageVersion)
-p:MdsPackageVersion=$(MdsPackageVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't get caught by the same gotcha that I did - make sure these either have a default value (in build.proj) or are conditionally included. Otherwise, they'll get permanently set to "".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have defaults brought in by src/Directory.Build.props -> Versions.props.

# If we're testing in Package mode, we have a few additional steps.
- ${{ if eq(parameters.referenceType, 'Package') }}:

# Create the packages/ directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm reversing course here... but maybe rather than this course, we just have the packages directory with a .gitkeep file in it or a readme that explains that what it's for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're correct - let's just ensure this directory always exists in the repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally these are going to be blown away with the new pipeline, post this and common mds project work.

Copilot AI review requested due to automatic review settings February 4, 2026 12:09
Copy link
Contributor

Copilot AI left a comment

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 63 out of 64 changed files in this pull request and generated 2 comments.

Comment on lines 1 to 2
# This directory must exist in order for NuGet restores to succeed prior to # our builds generating
# any NuGet package files here.
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The comment text here looks malformed: # This directory must exist in order for NuGet restores to succeed prior to # our builds generating contains an extra # and reads awkwardly. Please update it to a grammatically correct sentence (for example, remove the stray # and merge the two lines into a single clear sentence) so the intent of the comment is unambiguous.

Suggested change
# This directory must exist in order for NuGet restores to succeed prior to # our builds generating
# any NuGet package files here.
# This directory must exist so that NuGet restores succeed before our builds generate any NuGet package files here.

Copilot uses AI. Check for mistakes.
public class AADConnectionsTest
public class AADConnectionTest
{
class CustomSqlAuthenticationProvider : SqlAuthenticationProvider
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This helper became UsernamePasswordProvider in DataCommon.

// Clear token cache for code coverage.
ActiveDirectoryAuthenticationProvider.ClearUserTokenCache();
using (SqlConnection connection = new SqlConnection(DataTestUtility.AADPasswordConnectionString))
#pragma warning disable 0618 // Type or member is obsolete
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These blocks are an attempt to cleanup the global state and improve test reliability.

build.proj Outdated
$(DotnetPath)dotnet test "@(UnitTestsProj)"
-f $(TF)
-p:Configuration=$(Configuration)
-p:ReferenceType=Project
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of those times that the absence of ReferenceType looks weird (because it is needed everywhere else), and its presence looks weird (if you know that UnitTests doesn't explicitly need it). The src/Directory.Build.props does use it, but it applies a default of Project, so you're correct that it isn't strictly needed here. I will remove this and add a comment explaining why it is absent.

-p:Configuration=$(Configuration)
-p:ReferenceType=$(ReferenceType)
-p:AbstractionsPackageVersion=$(AbstractionsPackageVersion)
-p:MdsPackageVersion=$(MdsPackageVersion)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have defaults brought in by src/Directory.Build.props -> Versions.props.

# If we're testing in Package mode, we have a few additional steps.
- ${{ if eq(parameters.referenceType, 'Package') }}:

# Create the packages/ directory.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're correct - let's just ensure this directory always exists in the repo.

Copilot AI review requested due to automatic review settings February 4, 2026 14:36
Copy link
Contributor

Copilot AI left a comment

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 63 out of 64 changed files in this pull request and generated 1 comment.

…ogether

- Addressed Copilot review comments.
NuGet.config Outdated
packages that are not available on the public nuget.org feed, for example to test MDS that
depends on a version of Abstractions that was just built in the workspace.
-->
<add key="local" value="packages/" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a pretty strong preference against this approach. I think this will make it too easy to accidentally build and test against local artifacts when we mean to test against public ones. At any point, something could end up in the packages directory unexpectedly and it would be used without any indication or opt-in.

We can pass in the nuget file to use on the dotnet restore calls using the --configfile option: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-restore

…ogether

- Now using reference type to choose NuGet config file.
Copilot AI review requested due to automatic review settings February 4, 2026 18:18
Copy link
Contributor

Copilot AI left a comment

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 63 out of 64 changed files in this pull request and generated 1 comment.

…ogether

- Added missing reference type to AKV restore targets.
Copilot AI review requested due to automatic review settings February 4, 2026 19:37
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants