Skip to content

Preview Release v7.0.0-preview4

Pre-release
Pre-release

Choose a tag to compare

@mdaigle mdaigle released this 05 Mar 22:46
· 27 commits to main since this release
2fc206c

Changed

Azure Dependencies Removed from Core Package

What Changed:

  • The core Microsoft.Data.SqlClient package no longer depends on Azure.Core, Azure.Identity, or their transitive dependencies (e.g., Microsoft.Identity.Client, Microsoft.Web.WebView2). Azure Active Directory / Entra authentication functionality (ActiveDirectoryAuthenticationProvider and related types) has been extracted into a new Microsoft.Data.SqlClient.Extensions.Azure package that can be installed separately when needed. (#1108, #3680, #3902, #3904, #3908, #3917, #3982, #3978, #3986)
  • To support this separation, two additional packages were introduced: Microsoft.Data.SqlClient.Extensions.Abstractions (shared types between the core driver and extensions) and Microsoft.Data.SqlClient.Extensions.Logging (shared ETW tracing infrastructure). (#3626, #3628, #3967)

Who Benefits:

  • All users benefit from a significantly lighter core package. Previously, the Azure dependency chain pulled in numerous assemblies (including Azure.Core, Azure.Identity, Microsoft.Identity.Client, and Microsoft.Web.WebView2) even for applications that only needed basic SQL Server connectivity. This was the most upvoted open issue in the repository (#1108).
  • Users who do not use Azure AD authentication no longer carry Azure-related assemblies in their build output, reducing deployment size and eliminating confusion about unexpected dependencies.
  • Users who do use Azure AD authentication can now manage Azure dependency versions independently from the core driver.

Impact:

  • Applications using Azure AD authentication (e.g., ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryDefault, etc.) must now install the Microsoft.Data.SqlClient.Extensions.Azure NuGet package separately. No code changes are required beyond adding the package reference.

Added

Expose SSPI Context Provider as Public API

What Changed:

  • Added the SspiContextProvider abstract class and a public SspiContextProvider property on SqlConnection, allowing applications to supply a custom SSPI context provider for integrated authentication. This enables custom Kerberos ticket negotiation and NTLM username/password authentication scenarios that the driver does not natively support. (#2253, #2494)

Who Benefits:

  • Users authenticating across untrusted domains, non-domain-joined machines, or cross-platform environments where configuring integrated authentication on the client is difficult or impossible.
  • Users running in containers who need manual Kerberos negotiation without deploying sidecars or external ticket-refresh mechanisms.
  • Users who need NTLM username/password authentication to SQL Server, which the driver does not provide natively.

Impact:

  • Applications can set a custom SspiContextProvider on SqlConnection before opening the connection. The provider handles the authentication token exchange during integrated authentication. This is an additive API — existing authentication behavior is unchanged when no custom provider is set. See SspiContextProvider_CustomProvider.cs for a sample implementation.
  • Note: The SspiContextProvider is a part of the connection pool key. Care should be taken when using this property to ensure the implementation returns a stable identity per resource.

Expose Default Transient Error List

What Changed:

  • Exposed the default transient error codes list via the new SqlConfigurableRetryFactory.BaselineTransientErrors static property (returns a ReadOnlyCollection<int>), making it easier to extend the set of transient errors without copy-pasting from the repository source. (#3903)

Who Benefits:

  • Developers implementing custom retry logic who want to extend the built-in transient error list rather than replacing it.

Impact:

  • Applications can now access the default transient error codes and append their own application-specific error codes for retry handling.

Introduce App Context Switch for MultiSubnetFailover Default

What Changed:

  • Added a new app context switch Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault to set MultiSubnetFailover=true by default in connection strings. (#3841)

Who Benefits:

  • Applications that need MultiSubnetFailover enabled globally without modifying individual connection strings.

Impact:

  • Applications can enable MultiSubnetFailover globally using one of the following methods:
// In application code
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault", true);
<!-- In App.Config -->
<runtime>
  <AppContextSwitchOverrides value="Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault=true" />
</runtime>

Enhanced Routing Support

What Changed:

  • Added support for enhanced routing, a TDS feature that allows the server to redirect connections to a specific server and database. (#3641, #3969, #3970, #3973)

Who Benefits:

  • Users connecting to Azure SQL Hyperscale environments that use named read replicas and gateway-based load balancing.

Impact:

  • Enhanced routing is negotiated automatically during login when the server supports it. No application code changes are required. This feature is separate from ApplicationIntent=ReadOnly and does not require read-only intent to be set.

Fixed

  • Fixed ExecuteScalar to propagate errors when the server sends data followed by an error token. (#3912)

  • Fixed NullReferenceException in SqlDataAdapter when processing batch scenarios where certain SQL RPC calls may not include system parameters. (#3857)

  • Fixed reading of multiple app context switches from a single AppContextSwitchOverrides configuration field. (#3960)

  • Fixed a connection performance regression where SPN generation was triggered for non-integrated authentication modes (e.g., SQL authentication) on the native SNI path. (#3929)

  • Fixed an edge case in TdsParserStateObject.TryReadPlpBytes where zero-length reads returned null instead of an empty array. (#3872)

Other changes

  • Updated UserAgent feature to use a pipe-delimited format, replacing the previous JSON format. (#3826)

  • Minor improvements to Managed SNI tracing to capture continuation events and errors. (#3859)

  • Reverted public visibility of internal interop enums (IoControlCodeAccess and IoControlTransferType) that were accidentally made public during the project merge. (#3900)

  • Performance improvements. (#3791, #3772)

Contributors

We thank the following public contributors. Their efforts toward this project are very much appreciated.

Target Platform Support

  • .NET Framework 4.6.2+ (Windows x86, Windows x64, Windows ARM64)
  • .NET 8.0+ (Windows x86, Windows x64, Windows ARM, Windows ARM64, Linux, macOS)

Dependencies

.NET 9.0

  • Microsoft.Bcl.Cryptography 9.0.9
  • Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.Extensions.Logging 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 9.0.9
  • Microsoft.IdentityModel.JsonWebTokens 8.14.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.14.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 9.0.9
  • System.Security.Cryptography.Pkcs 9.0.9

.NET 8.0

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.Extensions.Logging 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.14.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.14.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 8.0.1
  • System.Security.Cryptography.Pkcs 8.0.1

.NET Standard 2.0

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.Extensions.Logging 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.14.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.14.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 8.0.1
  • System.Security.Cryptography.Pkcs 8.0.1
  • System.Text.Json 8.0.6
  • System.Threading.Channels 8.0.0

.NET Framework 4.6.2

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.Extensions.Logging 1.0.0-preview1.26064.3
  • Microsoft.Data.SqlClient.SNI 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.14.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.14.0
  • System.Buffers 4.6.1
  • System.Diagnostics.DiagnosticSource 8.0.1
  • System.Memory 4.6.3
  • System.Runtime.InteropServices.RuntimeInformation 4.3.0
  • System.Security.Cryptography.Pkcs 8.0.1
  • System.Text.Json 8.0.6
  • System.Threading.Channels 8.0.0
  • System.ValueTuple 4.6.1