This update brings the below changes over the previous release:
- Added support for Azure Active Directory Managed Identity authentication #730 [Read more]
- Added support to provide a user-defined application client ID when using Active Directory authentication #740 [Read more]
- Added the "Command Timeout" connection string property to set a default timeout for all commands executed with the connection #722 [Read more]
- Added support for Always Encrypted on all supported platforms for .NET Standard 2.0 #756 [Read more]
- Fixed unobserved exception issue when a timeout occurs before a faulted task completes with an exception #688 #773
- Fixed an issue where driver continues to prompt for credentials when using Azure Active Directory authentication #770
- Updated
Microsoft.Data.SqlClient.SNI
(.NET Framework dependency) andMicrosoft.Data.SqlClient.SNI.runtime
(.NET Core/Standard dependency) version tov2.1.1
and removed symbols fromMicrosoft.Data.SqlClient.SNI.runtime
, which are now published to Microsoft Symbols Server #764 [Read more] - Updated
Microsoft.Identity.Client
dependency version tov4.21.1
#765 - Performance improvements when establishing an encrypted channel by removing sync over async method calls #541
- Performance improvements by replacing heap-allocated arrays with Spans #667
- Moved common files to shared folder between .NET Framework and .NET Core implementation #734 #753
This preview release introduces support for Azure Active Directory authentication using managed identities.
The following authentication mode keywords are supported:
- Active Directory Managed Identity
- Active Directory MSI (for cross MS SQL drivers compatibility)
Connection string examples:
// For System Assigned Managed Identity
"Server:{serverURL}; Authentication=Active Directory MSI; Initial Catalog={db};"
// For System Assigned Managed Identity
"Server:{serverURL}; Authentication=Active Directory Managed Identity; Initial Catalog={db};"
// For User Assigned Managed Identity
"Server:{serverURL}; Authentication=Active Directory MSI; User Id={ObjectIdOfManagedIdentity}; Initial Catalog={db};"
// For User Assigned Managed Identity
"Server:{serverURL}; Authentication=Active Directory Managed Identity; User Id={ObjectIdOfManagedIdentity}; Initial Catalog={db};"
This preview release introduces support for passing a user-defined application client ID to the Microsoft Authentication Library, which will be used when authenticating with Azure Active Directory.
The following new APIs are introduced:
- A new constructor has been introduced in ActiveDirectoryAuthenticationProvider:
[Applies to all .NET Platforms (.NET Framework, .NET Core and .NET Standard)]
public ActiveDirectoryAuthenticationProvider(string applicationClientId)
Usage:
string APP_CLIENT_ID = "<GUID>";
SqlAuthenticationProvider customAuthProvider = new ActiveDirectoryAuthenticationProvider(APP_CLIENT_ID);
SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, customAuthProvider);
using (SqlConnection sqlConnection = new SqlConnection("<connection_string>")
{
sqlConnection.Open();
}
- A new configuration property has been introduced under
SqlAuthenticationProviderConfigurationSection
andSqlClientAuthenticationProviderConfigurationSection
:
[Applies to .NET Framework and .NET Core]
internal class SqlAuthenticationProviderConfigurationSection : ConfigurationSection
{
...
[ConfigurationProperty("applicationClientId", IsRequired = false)]
public string ApplicationClientId => this["applicationClientId"] as string;
}
// Inheritance
internal class SqlClientAuthenticationProviderConfigurationSection : SqlAuthenticationProviderConfigurationSection
{ ... }
Usage:
<configuration>
<configSections>
<section name="SqlClientAuthenticationProviders"
type="Microsoft.Data.SqlClient.SqlClientAuthenticationProviderConfigurationSection, Microsoft.Data.SqlClient" />
</configSections>
<SqlClientAuthenticationProviders applicationClientId ="<GUID>" />
</configuration>
<!--or-->
<configuration>
<configSections>
<section name="SqlAuthenticationProviders"
type="Microsoft.Data.SqlClient.SqlAuthenticationProviderConfigurationSection, Microsoft.Data.SqlClient" />
</configSections>
<SqlAuthenticationProviders applicationClientId ="<GUID>" />
</configuration>
This preview release introduces the "Command Timeout" connection string property to override the default of 30 seconds. The timeout for individual commands can be overridden using the CommandTimeout
property on the SqlCommand.
Connection string examples:
"Server:{serverURL}; Initial Catalog={db}; Integrated Security=true; Command Timeout=60"
This preview release extends support for Always Encrypted on the following platforms:
Target Framework | Platform | New Feature support |
---|---|---|
.NET Framework v4.6+ | Windows | No changes |
.NET Core 2.1+ | All operating systems | No changes |
.NET Standard 2.0 | All operating systems | Yes, support on all operating systems (without enclaves) |
.NET Standard 2.1+ | All operating systems | No changes |
We've removed the symbols introduced in v2.0.0 from Microsoft.Data.SqlClient.SNI.runtime NuGet starting with v2.1.1. The public symbols are now published to Microsoft Symbols Server for tools like BinSkim that require access to public symbols.
- .NET Framework 4.6+ (Windows x86, Windows x64)
- .NET Core 2.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
- Microsoft.Data.SqlClient.SNI 2.1.1
- Microsoft.Identity.Client 4.21.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
- Microsoft.Win32.Registry 4.7.0
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- System.Diagnostics.DiagnosticSource 4.7.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Runtime.Caching 4.7.0
- Microsoft.Identity.Client 4.21.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
- Microsoft.Win32.Registry 4.7.0
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- System.Diagnostics.DiagnosticSource 4.7.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Runtime.Caching 4.7.0
- Microsoft.Identity.Client 4.21.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
- Microsoft.Win32.Registry 4.7.0
- System.Buffers 4.5.1
- System.Memory 4.5.4
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- Microsoft.Identity.Client 4.21.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
- Microsoft.Win32.Registry 4.7.0
- System.Buffers 4.5.1
- System.Memory 4.5.4
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- Microsoft.Identity.Client 4.21.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
- Microsoft.IdentityModel.JsonWebTokens 5.6.0