如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

huangapple go评论62阅读模式
英文:

How to compose applicationClientId, applicationKey, or authority in KustoConnectionStringBuilder

问题

我非常不熟悉Kusto,我能够使用withuserpromtAuthentication连接数据库。但我想要使用WithAadApplicationKeyAuthentication连接Kusto。

我不了解applicationClientId、applicationKey或者与我的应用程序相关的authority。有人可以给出如何组成这些的示例吗?

var appId = "<appId>";
var appKey = "<appKey>";
var appTenant = "<appTenant>";
// 使用应用程序身份验证创建Kusto连接字符串
var kustoConnectionStringBuilderDM = new KustoConnectionStringBuilder(ingestUri)
    .WithAadApplicationKeyAuthentication(
        applicationClientId: appId,
        applicationKey: appKey,
        authority: appTenant
    );
英文:

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 = &quot;&lt;appId&gt;&quot;;
var appKey = &quot;&lt;appKey&gt;&quot;;
var appTenant = &quot;&lt;appTenant&gt;&quot;;
//Create Kusto connection string with App Authentication
var kustoConnectionStringBuilderDM = new KustoConnectionStringBuilder(ingestUri)
    .WithAadApplicationKeyAuthentication(
        applicationClientId: appId,
        applicationKey: appKey,
        authority: appTenant
    );

答案1

得分: 1

要获取applicationClientIdapplicationKeyauthority的值,您需要拥有Azure AD应用程序

我在我的租户中注册了一个Azure AD应用程序,步骤如下:

转到Azure门户 -> Azure活动目录 -> 应用程序注册 -> 新建注册

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

在该应用程序的概述中,您可以找到类似以下的applicationClientIdauthority的值:

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

要获取applicationKey的值,您需要创建一个客户端密钥,步骤如下:

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

您可以从以下截图中找到applicationKey

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

您可以在代码中使用这些来使用WithAadApplicationKeyAuthentication连接到Kusto。

参考链接:
Azure Data Explorer - Kusto查询:从Azure AD应用程序查询时出现未经授权错误 - Stack Overflow

英文:

> 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

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

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

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

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

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

You can find the value of applicationKey from below screenshot:

如何在KustoConnectionStringBuilder中组成applicationClientId、applicationKey或authority

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

huangapple
  • 本文由 发表于 2023年6月22日 19:11:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76531299.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定