-
Notifications
You must be signed in to change notification settings - Fork 321
Azure Split - Step 3 - Tie Everything Together #3908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.Abstractionspackage across all MDS projects (src and ref) - Updates test infrastructure with
UsernamePasswordProviderandManagedIdentityProviderimplementations for manual tests - Updates all pipeline YAML files to include
AbstractionsPackageVersionparameter 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 |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/UsernamePasswordProvider.cs
Show resolved
Hide resolved
There was a problem hiding this 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.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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.
....SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlAuthenticationProviderManagerTests.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Show resolved
Hide resolved
30140f6 to
18ac28b
Compare
…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.
25590be to
ad7ea2f
Compare
eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/test/WorkloadIdentityFederationTests.cs
Show resolved
Hide resolved
There was a problem hiding this 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set back to normal?
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlAuthenticationProviderManagerTests.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs
Show resolved
Hide resolved
benrr101
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 "".
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…ogether - Fixed missing ;
- Trying to fix test filters.
…ntains spaces and special characters.
…ogether - Addressed PR comments/suggestions.
There was a problem hiding this 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.
packages/.gitkeep
Outdated
| # This directory must exist in order for NuGet restores to succeed prior to # our builds generating | ||
| # any NuGet package files here. |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
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.
| # 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. |
| public class AADConnectionsTest | ||
| public class AADConnectionTest | ||
| { | ||
| class CustomSqlAuthenticationProvider : SqlAuthenticationProvider |
There was a problem hiding this comment.
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.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs
Show resolved
Hide resolved
| // Clear token cache for code coverage. | ||
| ActiveDirectoryAuthenticationProvider.ClearUserTokenCache(); | ||
| using (SqlConnection connection = new SqlConnection(DataTestUtility.AADPasswordConnectionString)) | ||
| #pragma warning disable 0618 // Type or member is obsolete |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
…ogether - Addressed Copilot feedback.
There was a problem hiding this 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/" /> |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
src/Microsoft.Data.SqlClient.Extensions/Azure/test/AADAuthenticationTests.cs
Show resolved
Hide resolved
…ogether - Fixed Azure build command lines.
…ogether - Added missing reference type to AKV restore targets.
Description
This PR ties everything together:
PR series:
Testing