Skip to content

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Jan 19, 2026

Description

This PR contains a variety of prep work that sets the stage for the addition of the Abstractions and Azure packages:

  • Lots of pipeline changes and cleanup to make it smoother to add the Abstractions and Azure packages to the mix.
  • Some cleanup adjacent to where the Azure code will be moved out of MDS.
  • Some improvements that were made along the way for general clarity or consistency.

I have added commentary around the interesting changes. This is probably the largest and most complex PR of this series.

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.

Make all of the common changes that aren't directly related to the Azure Split work,
but set the stage for it and will make subsequent PRs much easier to consume.
Copilot AI review requested due to automatic review settings January 19, 2026 15:52
@paulmedynski paulmedynski added the Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity. label Jan 19, 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

This PR represents "Step 1" of an Azure component split initiative, focusing on common infrastructure changes needed to support future modularization. The changes primarily refactor the build system, update pipeline configurations, and improve code quality without introducing functional changes to the driver itself.

Changes:

  • Refactored NuGet package generation by splitting monolithic targets into separate files for MDS, AKV, and SqlServer packages
  • Renamed and reorganized build properties (e.g., NugetPackageVersionmdsPackageVersion, AssemblyFileVersionmdsAssemblyFileVersion) to support multiple package versioning
  • Converted pipeline template paths from relative to absolute for better maintainability
  • Improved code quality with nullable annotations, property encapsulation, and defensive null checks
  • Updated test infrastructure to support both Project and Package reference types more cleanly

Reviewed changes

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

Show a summary per file
File Description
tools/targets/add-ons/GenerateAkvPackage.targets New target file for generating AKV NuGet packages with commit ID and version properties
tools/targets/add-ons/GenerateAKVProviderNugetPackage.targets Removed (replaced by GenerateAkvPackage.targets)
tools/targets/GenerateSqlServerPackage.targets New target file for generating SqlServer NuGet packages
tools/targets/GenerateMdsPackage.targets New target file for generating MDS NuGet packages with proper property passing
tools/targets/GenerateNugetPackage.targets Removed (functionality split into separate package-specific targets)
tools/targets/CopySniDllsForNetFxProjectReferenceBuilds.targets New helper target to copy SNI DLLs for .NET Framework project reference builds
tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec Updated to use $MdsPackageVersion$ variable instead of hardcoded version ranges
tools/specs/Microsoft.SqlServer.Server.nuspec Updated to use $ReferenceType$ property for flexible artifact paths
tools/specs/Microsoft.Data.SqlClient.nuspec Updated to use $ReferenceType$ property for flexible artifact paths
tools/props/Versions.props Reorganized version properties into logical groups (Common, SqlServer, MDS, AKV) with better documentation
src/Microsoft.SqlServer.Server/StringsHelper.cs Added braces to single-statement if blocks for consistency
src/Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj Changed DocumentationFile to use $(AssemblyName) variable
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/xunit.runner.json Updated for xUnit v2/v3 compatibility with comments and new configuration options
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/config.default.json Added WorkloadIdentityFederationServiceConnectionId property
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Utils.cs Removed unused using statement
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj Simplified to target only netstandard2.0, removed unused package references
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Config.cs Added comment about environment variable override
src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Packages.props Updated MDS version references and imported Versions.props
src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props Reduced .NET Framework test targets to net462 only
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj Added conditional Project/Package reference support for MDS
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj Reorganized references and imported CopySniDllsForNetFxProjectReferenceBuilds.targets
src/Microsoft.Data.SqlClient/tests/FunctionalTests/app.config Added comment for custom authentication provider
src/Microsoft.Data.SqlClient/tests/FunctionalTests/DataCommon/TestUtility.cs Added IsNet, IsNetCore, IsNetFramework properties to replace old naming
src/Microsoft.Data.SqlClient/tests/FunctionalTests/DataCommon/DummySqlAuthenticationProvider.cs Added braces to single-statement method
src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs Updated to use new TestUtility property names
src/Microsoft.Data.SqlClient/tests/Directory.Packages.props Removed MDS package version dependency (moved to root)
src/Microsoft.Data.SqlClient/tests/Directory.Build.props Removed ReferenceType default (moved to root Directory.Build.props)
src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj Reorganized conditional references for clarity
src/Microsoft.Data.SqlClient/tests/Common/Common.csproj Imported CopySniDllsForNetFxProjectReferenceBuilds.targets
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs Refactored SqlFedAuthInfo and SqlFedAuthToken to use properties and constructors instead of public fields
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs Updated to use new SqlFedAuthInfo constructor and properties
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlUtil.cs Added conditional compilation for Windows-specific imports
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlException.cs Improved null safety with defensive checks
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlErrorCollection.cs Changed Add method to return SqlErrorCollection for chaining
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs Added conditional compilation for Windows-specific imports
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationToken.cs Removed internal helper methods (moved to SqlFedAuthToken)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs Added conditional compilation for Windows-specific imports
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolIdentity.cs Fixed conditional compilation nesting
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs Updated to use new SqlFedAuthToken constructor and properties
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationTimeoutRetryHelper.cs Updated to use SqlFedAuthToken.AccessToken property
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.netfx.cs Added conditional compilation for Windows-specific imports
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Added AssemblyName and reorganized TargetFrameworks properties
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Changed DocumentationFile to use $(AssemblyName)
src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj Added AssemblyName and changed DocumentationFile
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Reordered properties for consistency
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj Added AssemblyName and changed DocumentationFile
src/Microsoft.Data.SqlClient/add-ons/Directory.Packages.props Removed (functionality moved to root)
src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props Removed ReferenceType and AllowedOutputExtensionsInPackageBuildOutputFolder properties
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj Reorganized conditional references for clarity
src/Directory.Build.props Updated ReferenceType documentation and default value handling
eng/pipelines/variables/akv-official-variables.yml Renamed assemblyFileVersion to akvAssemblyFileVersion and nugetPackageVersion to akvPackageVersion
eng/pipelines/steps/roslyn-analyzers-akv-step.yml Added akvPackageVersion parameter and documentation
eng/pipelines/steps/compound-nuget-pack-step.yml Added properties parameter for additional nuget properties
eng/pipelines/steps/compound-build-akv-step.yml Updated to use akvAssemblyFileVersion and akvPackageVersion parameters
eng/pipelines/stages/stress-tests-ci-stage.yml Reorganized parameters and improved documentation
eng/pipelines/sqlclient-pr-project-ref-pipeline.yml Changed buildType to referenceType
eng/pipelines/sqlclient-pr-package-ref-pipeline.yml Changed buildType to referenceType
eng/pipelines/libraries/variables.yml Updated template path to absolute
eng/pipelines/libraries/mds-validation-variables.yml Updated template paths and variable names
eng/pipelines/libraries/common-variables.yml Added assemblyBuildNumber calculation and renamed version variables
eng/pipelines/libraries/ci-build-variables.yml Updated variable names to akvPackageVersion and mdsPackageVersion
eng/pipelines/libraries/build-variables.yml Updated template paths to absolute
eng/pipelines/jobs/stress-tests-ci-job.yml Fixed comment (stage → job)
eng/pipelines/jobs/build-akv-official-job.yml Updated parameter names and moved Roslyn analysis before build
eng/pipelines/dotnet-sqlclient-signing-pipeline.yml Updated template paths and variable names
eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml Added dotnetVerbosity parameter and renamed buildType to referenceType
eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml Added dotnetVerbosity parameter and renamed buildType to referenceType
eng/pipelines/dotnet-sqlclient-ci-core.yml Renamed buildType to referenceType, added dotnetVerbosity, reorganized stages
eng/pipelines/common/templates/steps/* Multiple template files updated with parameter renames, absolute paths, and improved formatting
eng/pipelines/common/templates/stages/ci-run-tests-stage.yml Reorganized parameters and updated template paths
eng/pipelines/common/templates/jobs/* Multiple job files updated with parameter renames and mdsPackageVersion/mdsArtifactName support
eng/pipelines/akv-official-pipeline.yml Updated template path and variable names
build.proj Major refactoring: reorganized imports, properties, targets, and dependencies
NuGet.config.local New file for package reference builds with local packages/ directory
NuGet.config Updated with better documentation and renamed feed key
Directory.Packages.props Added conditional MDS/AKV package references and updated Azure.Identity version
BUILDGUIDE.md Comprehensive update explaining ReferenceType property and build workflows
.github/workflows/codeql.yml Added feat/* branches and explicit project builds
.editorconfig Added slnx and proj file extensions

Copilot AI review requested due to automatic review settings January 19, 2026 17:12
- Removed non-existent projects from CodeQL Workflow.
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 98 out of 98 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings January 19, 2026 19:31
@paulmedynski paulmedynski changed the title [DRAFT] Azure Split - Step 1 - Common Changes [DRAFT] Azure Split - Step 1 - Prep Work Jan 19, 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 98 out of 98 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings January 20, 2026 14:11
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 98 out of 98 changed files in this pull request and generated no new comments.

- Generating MDS NuGet package for subsequent AKV build in Package mode.
- Running Release build for Debug pipelines in Project mode to avoid NuGet packaging issues.
- Restoring default mdsPackageVersion for Project based runs.
- Restoring inhibition of NuGet package generation.
Copilot AI review requested due to automatic review settings January 20, 2026 16: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

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

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 85.22727% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.53%. Comparing base (2f9f533) to head (540acf0).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...Data/SqlClient/Connection/SqlConnectionInternal.cs 70.00% 12 Missing ⚠️
...Microsoft/Data/SqlClient/TdsParserHelperClasses.cs 96.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (2f9f533) and HEAD (540acf0). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (2f9f533) HEAD (540acf0)
netfx 2 1
netcore 2 1
addons 2 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3902      +/-   ##
==========================================
- Coverage   74.94%   67.53%   -7.41%     
==========================================
  Files         269      263       -6     
  Lines       43246    66191   +22945     
==========================================
+ Hits        32412    44705   +12293     
- Misses      10834    21486   +10652     
Flag Coverage Δ
addons ?
netcore 67.53% <82.95%> (-7.49%) ⬇️
netfx 66.51% <85.22%> (-7.65%) ⬇️

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 21, 2026 11:16
@paulmedynski paulmedynski requested a review from a team as a code owner January 21, 2026 11:16
@paulmedynski paulmedynski changed the title [DRAFT] Azure Split - Step 1 - Prep Work Azure Split - Step 1 - Prep Work Jan 21, 2026
mdaigle
mdaigle previously approved these changes Jan 27, 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.

This is a big PR so I don't even remember what I commented on at the beginning of it. But I hope you can address these comments and then I'll approve.

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

Comments suppressed due to low confidence (2)

eng/pipelines/common/templates/jobs/validate-signed-package-job.yml:71

  • This script still reads Versions.props via PropertyGroup[0].AssemblyFileVersion/AssemblyVersion, but those properties are no longer in the first <PropertyGroup> after the Versions.props refactor. This will yield empty values and can break the validation logic. Update to the correct group index (or, better, select the node by name/XPath instead of relying on ordering).
  - powershell: |
      # Sets the pipeline ASSEMBLY_VERSION variable.
      
      [Xml] $versionprops = Get-Content -Path ".\tools\props\Versions.props" 
      Write-Host $versionprops.Project.PropertyGroup[0].AssemblyFileVersion
      
      $AssemblyVersion =  $versionprops.Project.PropertyGroup[0].AssemblyVersion
      

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlException.cs:262

  • CreateException now partially treats errorCollection as nullable (later null checks), but it still dereferences it immediately in the for loop (errorCollection.Count / errorCollection[i]). If errorCollection can be null or empty, this will throw before your new guards run. Either restore the non-null contract (and keep the assert), or add an early guard that throws a clear ArgumentNullException/ArgumentException before building the message.

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.

Ok, I think I'm happy with this stuff

@paulmedynski paulmedynski merged commit b96fbdb into main Jan 29, 2026
272 checks passed
@paulmedynski paulmedynski deleted the dev/paul/azure/step1 branch January 29, 2026 18:53
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.

5 participants