This is the general availability release of Microsoft.Data.SqlClient 7.0, a major milestone for the .NET data provider for SQL Server. This release addresses the most upvoted issue in the repository's history — extracting Azure dependencies from the core package — introduces pluggable SSPI authentication, adds enhanced routing for Azure SQL Hyperscale, and delivers async read performance improvements.
Also released as part of this milestone:
- Released Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0. See release notes.
- Released Microsoft.Data.SqlClient.Extensions.Azure 1.0.0. See release notes.
- Released Microsoft.Data.SqlClient.Internal.Logging 1.0.0. See release notes.
- Released Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider 7.0.0. See release notes.
Changes Since 7.0.0-preview4
Added
- Added actionable error message when Entra ID authentication methods are used without the
Microsoft.Data.SqlClient.Extensions.Azurepackage installed, guiding users to install the correct package. (#3962, #4046) - Added Azure authentication sample application. (#3988)
Changed
Other changes
- Renamed the
Microsoft.Data.SqlClient.Extensions.Loggingpackage toMicrosoft.Data.SqlClient.Internal.Loggingto indicate it is for internal use only and should not be referenced directly by application code. (#4038) - Fixed non-localized exception strings. (#4022)
- Codebase merge and cleanup: (#3997, #4052)
- Various test improvements: (#3891, #3996, #4002, #4034, #4041, #4044)
- Documentation improvements (including Entra ID branding updates): (#4021, #4047, #4049)
- Updated Dependencies (#4045):
- Updated
Azure.Coreto v1.51.1 - Updated
Azure.Identityto v1.18.0 - Updated
Azure.Security.KeyVault.Keysto v4.9.0 - Updated
Microsoft.Extensions.Caching.Memoryto v9.0.13 (.NET 9.0) - Updated
Microsoft.IdentityModel.JsonWebTokensto v8.16.0 - Updated
Microsoft.IdentityModel.Protocols.OpenIdConnectto v8.16.0 - Updated
Microsoft.Bcl.Cryptographyto v9.0.13 (.NET 9.0) - Updated
System.Configuration.ConfigurationManagerto v9.0.13 (.NET 9.0) - Updated
System.Diagnostics.DiagnosticSourceto v10.0.3 - Updated
System.Security.Cryptography.Pkcsto v9.0.13 (.NET 9.0) - Updated
System.Text.Jsonto v10.0.3 - Updated
System.Threading.Channelsto v10.0.3 - Updated
System.ValueTupleto v4.6.2
- Updated
Cumulative Changes Since 6.1
This section summarizes all changes across the 7.0 preview cycle for users upgrading from the latest 6.1 stable release.
Changed
Azure Dependencies Removed from Core Package
What Changed:
- The core
Microsoft.Data.SqlClientpackage no longer depends onAzure.Core,Azure.Identity, or their transitive dependencies (e.g.,Microsoft.Identity.Client,Microsoft.Web.WebView2). Azure Active Directory / Entra ID authentication functionality (ActiveDirectoryAuthenticationProviderand related types) has been extracted into a newMicrosoft.Data.SqlClient.Extensions.Azurepackage. (#1108, #3680, #3902, #3904, #3908, #3917, #3982, #3978, #3986) - Two additional packages were introduced to support this separation:
Microsoft.Data.SqlClient.Extensions.Abstractions(shared types between the core driver and extensions) andMicrosoft.Data.SqlClient.Internal.Logging(shared ETW tracing infrastructure). (#3626, #3628, #3967, #4038)
Who Benefits:
- All users benefit from a significantly lighter core package. Previously, the Azure dependency chain pulled in numerous assemblies even for applications that only needed basic SQL Server connectivity. This was the most upvoted open issue in the repository.
- Users who do not use Entra ID authentication no longer carry Azure-related assemblies in their build output.
- Users who do use Entra ID authentication can now manage Azure dependency versions independently from the core driver.
Impact:
- Applications using Entra ID authentication (e.g.,
ActiveDirectoryInteractive,ActiveDirectoryDefault,ActiveDirectoryManagedIdentity, etc.) must now install theMicrosoft.Data.SqlClient.Extensions.AzureNuGet package separately:
dotnet add package Microsoft.Data.SqlClient.Extensions.Azure
- No code changes are required beyond adding the package reference.
- If an Entra ID authentication method is used without the Azure package installed, the driver now provides an actionable error message guiding users to install the correct package.
Added
Pluggable Authentication with SspiContextProvider
What Changed:
- Added a public
SspiContextProviderproperty onSqlConnection, completing the SSPI extensibility work begun in 6.1.0. Applications can now supply a custom SSPI context provider for integrated authentication, enabling custom Kerberos ticket negotiation and NTLM username/password authentication scenarios. (#2253, #2494)
Who Benefits:
- Users authenticating across untrusted domains, non-domain-joined machines, or cross-platform environments where configuring integrated authentication is difficult.
- 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
SspiContextProvideronSqlConnectionbefore opening the connection:
var connection = new SqlConnection(connectionString);
connection.SspiContextProvider = new MyKerberosProvider();
connection.Open();- The provider handles the authentication token exchange during integrated authentication. Existing authentication behavior is unchanged when no custom provider is set. See SspiContextProvider_CustomProvider.cs for a sample implementation.
- Note: The
SspiContextProvideris part of the connection pool key. Care should be taken when using this property to ensure the implementation returns a stable identity per resource.
Async Read Performance: Packet Multiplexing (Preview)
What Changed:
- Continued refinement of packet multiplexing with bug fixes and stability improvements since 6.1.0, plus new app context switches for opt-in control. (#3534, #3537, #3605)
Who Benefits:
- Applications performing large async reads (
ExecuteReaderAsyncwith big result sets, streaming scenarios, or bulk data retrieval).
Impact:
- Packet multiplexing ships behind two opt-in feature switches:
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityAsyncBehaviour", false);
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityProcessSni", false);- Setting both switches to
falseenables the new async processing path. By default, the driver uses the existing (compatible) behavior.
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 during login. (#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.
Support for .NET 10
What Changed:
- Updated pipelines and test suites to compile the driver using the .NET 10 SDK. (#3686)
Who Benefits:
- Developers targeting .NET 10 on day one.
Impact:
- SqlClient 7.0 compiles and tests against .NET 10, ensuring compatibility.
Strongly-Typed Diagnostic Events on .NET Framework
What Changed:
-
Enabled
SqlClientDiagnosticListenerforSqlCommandon .NET Framework, closing a long-standing observability gap where diagnostic events were previously only emitted on .NET Core. (#3658) -
Brought the 15 strongly-typed diagnostic event classes in the
Microsoft.Data.SqlClient.Diagnosticsnamespace — originally introduced for .NET Core in 6.0 — to .NET Framework as part of the codebase merge. Both platforms now use the same strongly-typed event model. The types cover command, connection, and transaction lifecycle events:SqlClientCommandBefore,SqlClientCommandAfter,SqlClientCommandErrorSqlClientConnectionOpenBefore,SqlClientConnectionOpenAfter,SqlClientConnectionOpenErrorSqlClientConnectionCloseBefore,SqlClientConnectionCloseAfter,SqlClientConnectionCloseErrorSqlClientTransactionCommitBefore,SqlClientTransactionCommitAfter,SqlClientTransactionCommitErrorSqlClientTransactionRollbackBefore,SqlClientTransactionRollbackAfter,SqlClientTransactionRollbackError
(#3493)
Who Benefits:
- .NET Framework users subscribing to
SqlClientDiagnosticListenerevents for observability, distributed tracing, or custom telemetry. These users now have parity with .NET Core, gaining IntelliSense, compile-time safety, and eliminating the need to access diagnostic payloads via reflection or dictionary lookups.
Impact:
- On .NET Framework,
SqlCommandnow emits the same diagnostic events that were previously only available on .NET Core. Subscribers toDiagnosticListenerevents (e.g.,Microsoft.Data.SqlClient.WriteCommandBefore) receive the strongly-typed objects:
listener.Subscribe(new Observer<KeyValuePair<string, object?>>(kvp =>
{
if (kvp.Value is SqlClientCommandBefore before)
{
Console.WriteLine($"Executing: {before.Command.CommandText}");
}
}));- The types implement
IReadOnlyList<KeyValuePair<string, object>>for backward compatibility with code that iterates properties generically.
Other Additions
- Added
SqlConfigurableRetryFactory.BaselineTransientErrorsstatic property exposing the default transient error codes list as aReadOnlyCollection<int>, making it easier to extend the default list with application-specific error codes. (#3903) - Added app context switch
Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefaultto setMultiSubnetFailover=trueglobally without modifying connection strings. (#3841) - Added app context switch
Switch.Microsoft.Data.SqlClient.IgnoreServerProvidedFailoverPartnerto let the client ignore server-provided failover partner info in Basic Availability Groups. (#3625) - Enabled User Agent Feature Extension (opt-in via
Switch.Microsoft.Data.SqlClient.EnableUserAgent). (#3606)
Changed
Deprecation of SqlAuthenticationMethod.ActiveDirectoryPassword
What Changed:
SqlAuthenticationMethod.ActiveDirectoryPassword(the ROPC flow) is now marked[Obsolete]and will generate compiler warnings. This aligns with Microsoft's move toward mandatory multifactor authentication. (#3671)
Who Benefits:
- Teams moving toward stronger, passwordless or MFA-compliant authentication.
Impact:
- If you use
Authentication=Active Directory Password, migrate to a supported alternative:
| Scenario | Recommended Authentication |
|---|---|
| Interactive / desktop apps | Active Directory Interactive |
| Service-to-service | Active Directory Service Principal |
| Azure-hosted workloads | Active Directory Managed Identity |
| Developer / CI environments | Active Directory Default |
- See Connect to Azure SQL with Microsoft Entra authentication for more information.
Breaking Changes
- Reverted public visibility of internal interop enums (
IoControlCodeAccessandIoControlTransferType) that were accidentally made public during the project merge. (#3900)
Other Changes
- Removed
Constrained Execution Regionerror handling blocks and associatedSqlConnectioncleanup. (#3535) - Performance improvements across SqlStatistics timing, Always Encrypted scenarios, and connection opening: (#3609, #3612, #3732, #3660, #3791, #3772, #3554)
- Allow
SqlBulkCopyto operate on hidden columns. (#3590) - 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)
Fixed
- 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
ExecuteScalarto propagate errors when the server sends data followed by an error token. (#3912) - Fixed
NullReferenceExceptioninSqlDataAdapterwhen processing batch scenarios. (#3857) - Fixed reading of multiple app context switches from a single
AppContextSwitchOverridesconfiguration field. (#3960) - Fixed an edge case in
TdsParserStateObject.TryReadPlpByteswhere zero-length reads returnednullinstead of an empty array. (#3872) - Fixed issue where extra connection deactivation was occurring. (#3758)
- Fixed debug assertion in connection pool (no impact to production code). (#3587)
- Prevented uninitialized performance counters escaping
CreatePerformanceCounters. (#3623) - Fixed
SetProviderto return immediately if user-defined authentication provider found. (#3620) - Fixed connection pool concurrency issue. (#3632)
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.13
- Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0
- Microsoft.Data.SqlClient.Internal.Logging 1.0.0
- Microsoft.Data.SqlClient.SNI.runtime 6.0.2
- Microsoft.Extensions.Caching.Memory 9.0.13
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 9.0.13
- System.Security.Cryptography.Pkcs 9.0.13
.NET 8.0
- Microsoft.Bcl.Cryptography 8.0.0
- Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0
- Microsoft.Data.SqlClient.Internal.Logging 1.0.0
- Microsoft.Data.SqlClient.SNI.runtime 6.0.2
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.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
- Microsoft.Data.SqlClient.Internal.Logging 1.0.0
- Microsoft.Data.SqlClient.SNI.runtime 6.0.2
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 8.0.1
- System.Security.Cryptography.Pkcs 8.0.1
- System.Text.Json 10.0.3
- System.Threading.Channels 10.0.3
.NET Framework 4.6.2+
- Microsoft.Bcl.Cryptography 8.0.0
- Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0
- Microsoft.Data.SqlClient.Internal.Logging 1.0.0
- Microsoft.Data.SqlClient.SNI 6.0.2
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- System.Buffers 4.6.1
- System.Diagnostics.DiagnosticSource 10.0.3
- System.Memory 4.6.3
- System.Runtime.InteropServices.RuntimeInformation 4.3.0
- System.Security.Cryptography.Pkcs 8.0.1
- System.Text.Json 10.0.3
- System.Threading.Channels 10.0.3
- System.ValueTuple 4.6.2