Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dotnet/SqlClient into scope
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Engel committed Jun 11, 2024
2 parents 673f53f + 3f0c4b1 commit 69c2fcb
Show file tree
Hide file tree
Showing 47 changed files with 1,000 additions and 253 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Stable release 5.2.1] - 2024-05-31

This update brings the below changes over the previous release:

### Changed

- Upgraded `Azure.Identity` version from 1.10.3 to 1.11.3 [#2492](https://github.com/dotnet/SqlClient/pull/2492), [#2528](https://github.com/dotnet/SqlClient/pull/2528)
- Upgraded `Microsoft.Identity.Client` version from 4.56.0 to 4.60.3 [#2492](https://github.com/dotnet/SqlClient/pull/2492)
- Code Health improvements: [#2467](https://github.com/dotnet/SqlClient/pull/2467)

### Fixed

- Fixed connection errors on Linux when Data Source property contains both named instance and port [#2436](https://github.com/dotnet/SqlClient/pull/2436)
- Fixed `SqlConnection.FireInfoMessageEventOnUserErrors` when set to true throws an exception [#2505](https://github.com/dotnet/SqlClient/pull/2505)
- Fixed exception when using `DATETIMEOFFSET(n)` in a TVP if `n` is 1, 2, 3, or 4 [#2506](https://github.com/dotnet/SqlClient/pull/2506)
- Reverted PR [#1983](https://github.com/dotnet/SqlClient/pull/1938) which caused connection failure delays when using `OpenAsync` [#2507](https://github.com/dotnet/SqlClient/pull/2507)
- Fixed `SqlConnection.Clone()` to include `AccessTokenCallback` [#2527](https://github.com/dotnet/SqlClient/pull/2527)

## [Stable release 5.2.0] - 2024-02-28

### Added
Expand Down
15 changes: 11 additions & 4 deletions doc/samples/SqlConnection_AccessTokenCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ static void Main()

private static void OpenSqlConnection()
{
const string defaultScopeSuffix = "/.default";
string connectionString = GetConnectionString();
using (SqlConnection connection = new SqlConnection("Data Source=contoso.database.windows.net;Initial Catalog=AdventureWorks;")
DefaultAzureCredential credential = new();

using (SqlConnection connection = new(connectionString)
{
AccessTokenCallback = async (authParams, cancellationToken) =>
{
var cred = new DefaultAzureCredential();
string scope = authParams.Resource.EndsWith(s_defaultScopeSuffix) ? authParams.Resource : authParams.Resource + s_defaultScopeSuffix;
var token = await cred.GetTokenAsync(new TokenRequestContext(new[] { scope }), cancellationToken);
string scope = authParams.Resource.EndsWith(defaultScopeSuffix)
? authParams.Resource
: $"{authParams.Resource}{defaultScopeSuffix}";
AccessToken token = await credential.GetTokenAsync(
new TokenRequestContext([scope]),
cancellationToken);
return new SqlAuthenticationToken(token.Token, token.ExpiresOn);
}
})
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The default value of the `ServerCertificate` connection setting is an empty stri

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -95,7 +95,7 @@ The default value of the `ServerCertificate` connection setting is an empty stri

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -53,7 +53,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -61,7 +61,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -50,7 +50,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.7.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -53,7 +53,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.1/5.1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.2
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
Expand All @@ -55,7 +55,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.2/5.2.0-preview1.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.8.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -82,7 +82,7 @@ Thanks to the following public contributors. Their efforts toward this project a

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.6.0
- Microsoft.Identity.Client 4.47.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.2/5.2.0-preview2.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Example usage:

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.8.0
- Microsoft.Identity.Client 4.53.0
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -103,7 +103,7 @@ Example usage:

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.6.0
- Microsoft.Identity.Client 4.53.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
4 changes: 2 additions & 2 deletions release-notes/5.2/5.2.0-preview3.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Example usage:

#### .NET

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.8.0
- Microsoft.Identity.Client 4.53.0
- Microsoft.IdentityModel.JsonWebTokens 6.24.0
Expand All @@ -100,7 +100,7 @@ Example usage:

#### .NET Standard

- Microsoft.Data.SqlClient.SNI 5.1.0
- Microsoft.Data.SqlClient.SNI.runtime 5.1.0
- Azure.Identity 1.6.0
- Microsoft.Identity.Client 4.53.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
Expand Down
8 changes: 4 additions & 4 deletions release-notes/5.2/5.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Example usage:

#### .NET 6

- Microsoft.Data.SqlClient.SNI 5.2.0
- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
Expand All @@ -228,7 +228,7 @@ Example usage:

#### .NET 8

- Microsoft.Data.SqlClient.SNI 5.2.0
- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
Expand All @@ -240,7 +240,7 @@ Example usage:

#### .NET Standard 2.0

- Microsoft.Data.SqlClient.SNI 5.2.0
- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
Expand All @@ -259,7 +259,7 @@ Example usage:

#### .NET Standard 2.1

- Microsoft.Data.SqlClient.SNI 5.2.0
- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.10.3
- Microsoft.Identity.Client 4.56.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
Expand Down
99 changes: 99 additions & 0 deletions release-notes/5.2/5.2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Release Notes

## [Stable release 5.2.1] - 2024-05-31

This update brings the below changes over the previous release:

### Changed

- Upgraded `Azure.Identity` version from 1.10.3 to 1.11.3 [#2492](https://github.com/dotnet/SqlClient/pull/2492), [#2528](https://github.com/dotnet/SqlClient/pull/2528)
- Upgraded `Microsoft.Identity.Client` version from 4.56.0 to 4.60.3 [#2492](https://github.com/dotnet/SqlClient/pull/2492)
- Code Health improvements: [#2467](https://github.com/dotnet/SqlClient/pull/2467)

### Fixed

- Fixed connection errors on Linux when Data Source property contains both named instance and port [#2436](https://github.com/dotnet/SqlClient/pull/2436)
- Fixed `SqlConnection.FireInfoMessageEventOnUserErrors` when set to true throws an exception [#2505](https://github.com/dotnet/SqlClient/pull/2505)
- Fixed exception when using `DATETIMEOFFSET(n)` in a TVP if `n` is 1, 2, 3, or 4 [#2506](https://github.com/dotnet/SqlClient/pull/2506)
- Reverted PR [#1983](https://github.com/dotnet/SqlClient/pull/1938) which caused connection failure delays when using `OpenAsync` [#2507](https://github.com/dotnet/SqlClient/pull/2507)
- Fixed `SqlConnection.Clone()` to include `AccessTokenCallback` [#2527](https://github.com/dotnet/SqlClient/pull/2527)

## Target Platform Support

- .NET Framework 4.6.2+ (Windows x86, Windows x64)
- .NET 6.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)

### Dependencies

#### .NET Framework

- Microsoft.Data.SqlClient.SNI 5.2.0
- Azure.Identity 1.11.3
- Microsoft.Identity.Client 4.60.3
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- System.Buffers 4.5.1
- System.Configuration.ConfigurationManager 6.0.1
- System.Runtime.InteropServices.RuntimeInformation 4.3.0
- System.Text.Encoding.Web 6.0.0

#### .NET 6

- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.11.3
- Microsoft.Identity.Client 4.60.3
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 6.0.1
- System.Runtime.Caching 6.0.0

#### .NET 8

- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.11.3
- Microsoft.Identity.Client 4.60.3
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 8.0.0
- System.Runtime.Caching 8.0.0

#### .NET Standard 2.0

- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.11.3
- Microsoft.Identity.Client 4.60.3
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- Microsoft.Win32.Registry 5.0.0
- System.Buffers 4.5.1
- System.Configuration.ConfigurationManager 6.0.1
- System.Diagnostics.DiagnosticSource 6.0.1
- System.Runtime.Caching 6.0.0
- System.Text.Encoding.CodePages 6.0.0
- System.Text.Encodings.Web 6.0.0
- System.Runtime.Loader 4.3.0
- System.Security.Cryptography.Cng 5.0.0
- System.Security.Principal.Windows 5.0.0

#### .NET Standard 2.1

- Microsoft.Data.SqlClient.SNI.runtime 5.2.0
- Azure.Identity 1.11.3
- Microsoft.Identity.Client 4.60.3
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- Microsoft.Win32.Registry 5.0.0
- System.Configuration.ConfigurationManager 6.0.1
- System.Diagnostics.DiagnosticSource 6.0.1
- System.Runtime.Caching 6.0.0
- System.Text.Encoding.CodePages 6.0.0
- System.Text.Encodings.Web 6.0.0
- System.Runtime.Loader 4.3.0
- System.Security.Cryptography.Cng 5.0.0
- System.Security.Principal.Windows 5.0.0

1 change: 1 addition & 0 deletions release-notes/5.2/5.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 5.2 stable releases have been shipped:

| Release Date | Version | Notes |
| :-- | :-- | :--: |
| 2024/05/31 | 5.2.1 | [release notes](5.2.1.md) |
| 2024/02/28 | 5.2.0 | [release notes](5.2.0.md) |

The following Microsoft.Data.SqlClient 5.2 preview releases have been shipped:
Expand Down
1 change: 1 addition & 0 deletions release-notes/5.2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 5.2 stable releases have been shipped:

| Release Date | Version | Notes |
| :-- | :-- | :--: |
| 2024/05/31 | 5.2.1 | [release notes](5.2.1.md) |
| 2024/02/28 | 5.2.0 | [release notes](5.2.0.md) |

The following Microsoft.Data.SqlClient 5.2 preview releases have been shipped:
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ReferenceType Condition="'$(ReferenceType)'==''">Project</ReferenceType>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFramework)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>

<!--These properties can be modified locally to target .NET version of choice to build and test entire test suite-->
Expand Down
Loading

0 comments on commit 69c2fcb

Please sign in to comment.