From ea104ab76a5b6e5820ad322592e0a39983836997 Mon Sep 17 00:00:00 2001 From: vplauzon Date: Thu, 9 Jun 2022 08:02:02 -0400 Subject: [PATCH 1/3] Update most packages --- .../DeltaKustoAdxIntegrationTest.csproj | 6 +++--- code/DeltaKustoApi/DeltaKustoApi.csproj | 6 +++--- .../DeltaKustoFileIntegrationTest.csproj | 6 +++--- code/DeltaKustoIntegration/DeltaKustoIntegration.csproj | 2 +- code/DeltaKustoUnitTest/DeltaKustoUnitTest.csproj | 6 +++--- code/delta-kusto/delta-kusto.csproj | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj b/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj index c8cbb7f3..53f8637f 100644 --- a/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj +++ b/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj @@ -18,13 +18,13 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/code/DeltaKustoApi/DeltaKustoApi.csproj b/code/DeltaKustoApi/DeltaKustoApi.csproj index 815359c7..0c4a0c3b 100644 --- a/code/DeltaKustoApi/DeltaKustoApi.csproj +++ b/code/DeltaKustoApi/DeltaKustoApi.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/code/DeltaKustoFileIntegrationTest/DeltaKustoFileIntegrationTest.csproj b/code/DeltaKustoFileIntegrationTest/DeltaKustoFileIntegrationTest.csproj index c18c2f4e..a769b8ab 100644 --- a/code/DeltaKustoFileIntegrationTest/DeltaKustoFileIntegrationTest.csproj +++ b/code/DeltaKustoFileIntegrationTest/DeltaKustoFileIntegrationTest.csproj @@ -18,13 +18,13 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/code/DeltaKustoIntegration/DeltaKustoIntegration.csproj b/code/DeltaKustoIntegration/DeltaKustoIntegration.csproj index 65ea027a..23dff501 100644 --- a/code/DeltaKustoIntegration/DeltaKustoIntegration.csproj +++ b/code/DeltaKustoIntegration/DeltaKustoIntegration.csproj @@ -16,7 +16,7 @@ - + diff --git a/code/DeltaKustoUnitTest/DeltaKustoUnitTest.csproj b/code/DeltaKustoUnitTest/DeltaKustoUnitTest.csproj index 66589ca2..aa36d496 100644 --- a/code/DeltaKustoUnitTest/DeltaKustoUnitTest.csproj +++ b/code/DeltaKustoUnitTest/DeltaKustoUnitTest.csproj @@ -23,13 +23,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/code/delta-kusto/delta-kusto.csproj b/code/delta-kusto/delta-kusto.csproj index cc17618f..f035528c 100644 --- a/code/delta-kusto/delta-kusto.csproj +++ b/code/delta-kusto/delta-kusto.csproj @@ -24,10 +24,10 @@ - - - - + + + + From e64d402e26dcdcfe6b9a827633dc672ad0f95a5c Mon Sep 17 00:00:00 2001 From: vplauzon Date: Thu, 9 Jun 2022 08:57:01 -0400 Subject: [PATCH 2/3] Try to update to Microsoft.Identity.Client --- .../DeltaKustoAdxIntegrationTest.csproj | 2 +- .../GivenTokenProviderTest.cs | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj b/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj index 53f8637f..6707e77f 100644 --- a/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj +++ b/code/DeltaKustoAdxIntegrationTest/DeltaKustoAdxIntegrationTest.csproj @@ -17,7 +17,7 @@ - + diff --git a/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs b/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs index 04b2b10e..95322ac3 100644 --- a/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs +++ b/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs @@ -1,7 +1,8 @@ using DeltaKustoIntegration.Database; using DeltaKustoLib; using DeltaKustoLib.CommandModel; -using Microsoft.IdentityModel.Clients.ActiveDirectory; +//using Microsoft.IdentityModel.Clients.ActiveDirectory; +using Microsoft.Identity.Client; using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -24,11 +25,19 @@ public GivenTokenProviderTest() [Fact] public async Task TestGivenToken() { - var authenticationContext = - new AuthenticationContext("https://login.windows.net/" + TenantId); - var authenticationResult = await authenticationContext.AcquireTokenAsync( - ClusterUri.ToString(), - new ClientCredential(ServicePrincipalId, ServicePrincipalSecret)); + var clientApp = ConfidentialClientApplicationBuilder + .Create(ServicePrincipalId) + .WithClientSecret(ServicePrincipalSecret) + .WithTenantId(TenantId) + .Build(); + var authenticationResult = await clientApp + .AcquireTokenForClient(new[] { ClusterUri.ToString() }) + .ExecuteAsync(); + //var authenticationContext = + // new AuthenticationContext("https://login.windows.net/" + TenantId); + //var authenticationResult = await authenticationContext.AcquireTokenAsync( + // ClusterUri.ToString(), + // new ClientCredential(ServicePrincipalId, ServicePrincipalSecret)); var token = authenticationResult.AccessToken; var targetDbName = await InitializeDbAsync(); var overrides = ImmutableArray<(string path, string value)> From ea220e9df9eb4e367b640635eabda0be53ab6ae3 Mon Sep 17 00:00:00 2001 From: vplauzon Date: Thu, 9 Jun 2022 09:00:27 -0400 Subject: [PATCH 3/3] Complete migration to Microsoft.Identity.Client --- .../GivenTokenProvider/GivenTokenProviderTest.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs b/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs index 95322ac3..77d82ee4 100644 --- a/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs +++ b/code/DeltaKustoAdxIntegrationTest/GivenTokenProvider/GivenTokenProviderTest.cs @@ -1,7 +1,6 @@ using DeltaKustoIntegration.Database; using DeltaKustoLib; using DeltaKustoLib.CommandModel; -//using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.Identity.Client; using System; using System.Collections.Generic; @@ -31,13 +30,8 @@ public async Task TestGivenToken() .WithTenantId(TenantId) .Build(); var authenticationResult = await clientApp - .AcquireTokenForClient(new[] { ClusterUri.ToString() }) + .AcquireTokenForClient(new[] { $"{ClusterUri}/.default" }) .ExecuteAsync(); - //var authenticationContext = - // new AuthenticationContext("https://login.windows.net/" + TenantId); - //var authenticationResult = await authenticationContext.AcquireTokenAsync( - // ClusterUri.ToString(), - // new ClientCredential(ServicePrincipalId, ServicePrincipalSecret)); var token = authenticationResult.AccessToken; var targetDbName = await InitializeDbAsync(); var overrides = ImmutableArray<(string path, string value)>