Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compose applicationClientId, applicationKey, or authority in KustoConnectionStringBuilder

I am very new to Kusto, and I am able to connect Database using withuserpromtAuthentication. But I want to connect to Kusto using WithAadApplicationKeyAuthentication.

I am not aware of applicationClientId, applicationKey, or authority w.r.t. my application. Can anyone give examples of how to compose these?

var appId = "<appId>";
var appKey = "<appKey>";
var appTenant = "<appTenant>";
//Create Kusto connection string with App Authentication
var kustoConnectionStringBuilderDM = new KustoConnectionStringBuilder(ingestUri)
    .WithAadApplicationKeyAuthentication(
        applicationClientId: appId,
        applicationKey: appKey,
        authority: appTenant
    );
like image 642
Sravani Avatar asked Sep 06 '25 08:09

Sravani


1 Answers

To get values of applicationClientId, applicationKey and authority, you need to have Azure AD application.

I registered one Azure AD application in my tenant like below:

Go to Azure Portal -> Azure Active Directory -> App registrations -> New registration

enter image description here

In the Overview of that application, you can find applicationClientId and authority values like this:

enter image description here

To get value of applicationKey, you need to create one client secret like below:

enter image description here

You can find the value of applicationKey from below screenshot:

enter image description here

You can use these values in your code to connect to Kusto using WithAadApplicationKeyAuthentication.

Reference: Azure Data Explorer - Kusto query: unauthorized error querying from an Azure AD application - Stack Overflow

like image 81
Sridevi Avatar answered Sep 09 '25 00:09

Sridevi