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
);
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
In the Overview of that application, you can find applicationClientId and authority values like this:
To get value of applicationKey
, you need to create one client secret like below:
You can find the value of applicationKey
from below screenshot:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With