diff --git a/doc/apps/AzureAuthentication/App.cs b/doc/apps/AzureAuthentication/App.cs index 9da696d555..5c7dddea6e 100644 --- a/doc/apps/AzureAuthentication/App.cs +++ b/doc/apps/AzureAuthentication/App.cs @@ -1,6 +1,5 @@ using System.Diagnostics; -using Azure.Identity; using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider; @@ -82,15 +81,6 @@ internal int Run(RunOptions options) Authentication: {builder.Authentication} """); - - if (options.Verbose) - { - Out($""" - Full connection string: - {builder} - - """); - } } catch (Exception ex) { @@ -109,10 +99,9 @@ internal int Run(RunOptions options) // Enable SqlClient event logging if requested. if (options.LogEvents) { - string prefix = "[EVENT]"; - Out($"SqlClient event logging enabled; events will be prefixed with {prefix}"); + Out($"SqlClient event logging enabled; events will be prefixed with {SqlClientEventListener.Prefix}"); - _eventListener = new SqlClientEventListener(Out, prefix); + _eventListener = new SqlClientEventListener(Out, SqlClientEventListener.Prefix); } // Pause for trace attachment if requested. @@ -127,9 +116,10 @@ internal int Run(RunOptions options) Console.ReadLine(); } - // Instantiate the AKV Provider to ensure its assembly is present, loadable, contains the - // expected types, and at least the constructor functions. - _ = new SqlColumnEncryptionAzureKeyVaultProvider(new DefaultAzureCredential(true)); + // Load the AKV Provider assembly to ensure it is present, loadable, and contains the + // expected types. This is a lightweight check that detects transitive dependency conflicts + // without allocating a credential or invoking any external service. + _ = typeof(SqlColumnEncryptionAzureKeyVaultProvider).Assembly; try { diff --git a/doc/apps/AzureAuthentication/EntryPoint.cs b/doc/apps/AzureAuthentication/EntryPoint.cs index 847224e289..4ad1d0ed40 100644 --- a/doc/apps/AzureAuthentication/EntryPoint.cs +++ b/doc/apps/AzureAuthentication/EntryPoint.cs @@ -66,6 +66,7 @@ Supply specific package versions when building to test different versions of the verboseOption }; + int exitCode = 0; rootCommand.SetAction(parseResult => { App.RunOptions options = new() @@ -77,9 +78,10 @@ Supply specific package versions when building to test different versions of the }; using App app = new(); - return app.Run(options); + exitCode = app.Run(options); }); - return rootCommand.Parse(args).Invoke(); + rootCommand.Parse(args).Invoke(); + return exitCode; } } diff --git a/doc/apps/AzureAuthentication/README.md b/doc/apps/AzureAuthentication/README.md index c89456dd4e..2c7cb5fc98 100644 --- a/doc/apps/AzureAuthentication/README.md +++ b/doc/apps/AzureAuthentication/README.md @@ -33,8 +33,8 @@ Package versions are controlled through MSBuild properties. Pass them on the com | Property | Default | Description | | --- | --- | --- | -| `SqlClientVersion` | `6.1.4` | Version of `Microsoft.Data.SqlClient` to reference. | -| `AkvProviderVersion` | `6.1.2` | Version of `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` to reference. | +| `SqlClientVersion` | `7.0.0-preview4.26064.3` | Version of `Microsoft.Data.SqlClient` to reference. | +| `AkvProviderVersion` | `7.0.0-preview1.26064.3` | Version of `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` to reference. | | `AzureVersion` | None | Version of `Microsoft.Data.SqlClient.Extensions.Azure` to reference. When omitted, the `Azure` package will not be referenced. | ## Local Package Source @@ -68,7 +68,7 @@ Description: Supply specific package versions when building to test different versions of the SqlClient suite, for example: - -p:SqlClientVersion=7.0.0.preview4 + -p:SqlClientVersion=7.0.0-preview4 -p:AkvProviderVersion=7.0.1-preview2 -p:AzureVersion=1.0.0-preview1 diff --git a/doc/apps/AzureAuthentication/SqlClientEventListener.cs b/doc/apps/AzureAuthentication/SqlClientEventListener.cs index 5e861f4796..1fd91698b3 100644 --- a/doc/apps/AzureAuthentication/SqlClientEventListener.cs +++ b/doc/apps/AzureAuthentication/SqlClientEventListener.cs @@ -24,6 +24,16 @@ internal SqlClientEventListener(Action output, string prefix) #endregion + // ────────────────────────────────────────────────────────────────── + #region Constants + + /// + /// The default prefix prepended to each emitted event message. + /// + internal const string Prefix = "[EVENT]"; + + #endregion + // ────────────────────────────────────────────────────────────────── #region Derived Methods diff --git a/doc/apps/AzureAuthentication/packages/.gitkeep b/doc/apps/AzureAuthentication/packages/.gitkeep index 72ae807a91..eb0f557d02 100644 --- a/doc/apps/AzureAuthentication/packages/.gitkeep +++ b/doc/apps/AzureAuthentication/packages/.gitkeep @@ -1,2 +1,2 @@ -# This presence of this file ensures that git creates the packages/ directory, which must exist +# The presence of this file ensures that git creates the packages/ directory, which must exist # because it is declared in our NuGet.config. diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln index 42bbcb4374..a82d9f616c 100644 --- a/src/Microsoft.Data.SqlClient.sln +++ b/src/Microsoft.Data.SqlClient.sln @@ -380,6 +380,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient", "Microsoft.Data.SqlClient\src\Microsoft.Data.SqlClient.csproj", "{AA77C107-9A78-4A99-98BB-21FF7A1E0B01}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureAuthentication", "..\doc\apps\AzureAuthentication\AzureAuthentication.csproj", "{C3FE67C1-D288-45ED-A35C-08107396F8BB}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "notsupported", "notsupported", "{351BE847-A0BF-450C-A5BC-8337AFA49EAA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient", "Microsoft.Data.SqlClient\notsupported\Microsoft.Data.SqlClient.csproj", "{1DB299CE-95EA-4566-84DD-171768758291}"