英文:
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 = "<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
);
答案1
得分: 1
要获取applicationClientId
、applicationKey
和authority
的值,您需要拥有Azure AD应用程序。
我在我的租户中注册了一个Azure AD应用程序,步骤如下:
转到Azure门户 -> Azure活动目录 -> 应用程序注册 -> 新建注册
在该应用程序的概述中,您可以找到类似以下的applicationClientId
和authority
的值:
要获取applicationKey
的值,您需要创建一个客户端密钥,步骤如下:
您可以从以下截图中找到applicationKey
的值:
您可以在代码中使用这些值来使用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
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论