SOLVED

Missing method WithAadUserPromptAuthentication in Microsoft.Azure.Kusto.Data.NETStandard Nuget

Microsoft

 

I am using Nuget Microsoft.Azure.Kusto.Data.NETStandard (latest version published yesterday).

With the previous version I used to get the following error.

Kusto Connection String Builder has some invalid or conflicting properties: specified 'AAD Username password' authentication method has incorrect properties set. ',

Please consult Kusto Connection String documentation at https://docs.microsoft.com/en-us/azure/kusto/api/connection-strings/kusto

 

However, now the error changed and gives me further details as below.

Kusto Connection String Builder has some invalid or conflicting properties: Specified 'AAD Username password' authentication method has some incorrect properties. Missing: [User ID,Password].. ',

Please consult Kusto Connection String documentation at https://docs.microsoft.com/en-us/azure/kusto/api/connection-strings/kusto

Once I provided User ID and Password, it succeeded. (Which I don’t want to)

 

I also used KustoConnectionStringBuilder class from Microsoft.Azure.Kusto.Data  Nuget (.net framework) allows me to connect with out passing user name and password with the below highlighted method.

var kustoConnectionStringBuilder = new KustoConnectionStringBuilder($"https://{serviceName}.kusto.windows.net")

                    .WithAadUserPromptAuthentication(authority);

 

So my question is,

  • Why is this method missing from .NetStandard Nuget?
6 Replies

I think that when they added the .NETStandard library, that functionality wasn't available. They do take requests for features on User Voice so I recommend that you request it here: https://feedback.azure.com/forums/915733-azure-data-explorer

best response confirmed by Ben Martens (Microsoft)
Solution

The reason for the method WithAadUserPromptAuthentication being absent in the .NET Standard version of the SDK is that this scenario (with interactive pop-up dialog) is not implemented in ADAL (AAD Authentication Library) for .NET Standard.

 

Hope this helps.

 

Thank you Vladik. That answers my question. A follow up question.

Do I have an option to use integrated windows authentication with  Microsoft.Azure.Kusto.Data.NETStandard

Hi @lakyed .

Did you get any solution for this WithAadUserPromptAuthentication method?

How to pull data of kusto database into visual studio?

Could you plz share any sample code which will be working with useriD Password and federated property.?

 

Or instead of console application? could you plz guide me for web application. I want to pull data into web application .... 

 

@NikitaBhopale Vladik answered the question above. This function is not supported by the underlying AAD library in the .NETStandard/.NETCore versions because they don't have any support for popping up the UI challenge dialog. I'm not totally clear on your question, but if you're just looking for examples of querying Kusto using a console or web app, check out the docs: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/netfx/about-kusto-data 

@NikitaBhopale The question was posted long ago and is not applicable any more I guess. The reason being Kusto authentication is now through AAD app authentication. Below is the code sample that I am using for my connection currently in a .NetStandard project.

// Create Kusto connection
            var serviceUri = appSettings.KustoConfigSection.HostAddress;
            var authority = "72f988bf-86f1-41af-91ab-2d7cd011db47"; // AAD tenant GUID
            var applicationClientId = appSettings.KustoConfigSection.AppID; // App ID
            var applicationKey = appSettings.KustoConfigSection.ClientSecret; // Client secret

            KustoConnectionStringBuilder kustoConnectionString = new KustoConnectionStringBuilder(serviceUri)
                .WithAadApplicationKeyAuthentication(applicationClientId, applicationKey, authority);

            this.searchClient = KustoClientFactory.CreateCslQueryProvider(kustoConnectionString);
            this.searchClient.DefaultDatabaseName = appSettings.KustoConfigSection.Database;

 

1 best response

Accepted Solutions
best response confirmed by Ben Martens (Microsoft)
Solution

The reason for the method WithAadUserPromptAuthentication being absent in the .NET Standard version of the SDK is that this scenario (with interactive pop-up dialog) is not implemented in ADAL (AAD Authentication Library) for .NET Standard.

 

Hope this helps.

 

View solution in original post