gpt4 book ai didi

c# - 如何用C#连接kusto数据库?

转载 作者:行者123 更新时间:2023-12-02 23:00:17 26 4
gpt4 key购买 nike

WithAadUserPromptAuthentication 丢失,所以我无法使用 Microsoft 文档提供的示例代码?那是:

var serviceUri = "Service URI, typically of the form https://cluster.region.kusto.windows.net";
var authority = "contoso.com"; // Or the AAD tenant GUID: "..."

// Recommended syntax
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(serviceUri)
.WithAadUserPromptAuthentication(authority);

// Legacy syntax
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(serviceUri)
{
FederatedSecurity = true,
InitialCatalog = "NetDefaultDB",
Authority = authority,
};

// Equivalent Kusto connection string: $"Data Source={serviceUri};Database=NetDefaultDB;Fed=True;Authority Id={authority}"

是否有任何新的解决方案可以替代 WithAadUserPromptAuthentication 方法?

最佳答案

Microsoft.Azure.Kusto.Data.NETStandard 已弃用且不再维护。请使用 Microsoft.Azure.Kusto.Data 包(.Net Framework 和 .Net Core 风格)。

由于使用了身份验证库 (ADAL),此方法不适用于 .Net Core,仅适用于 .Net Framework 包。您可以在 .Net Core 中使用的解决方法是通过在 KustoConnectionStringBuilder 实例上手动设置以下属性来触发用户名/密码身份验证:FederatedSecurity、UserID、Password、Authority。

我们计划发布使用下一代身份验证库 (MSAL) 构建的软件包的新版本,该版本将在所有平台上公开此方法(交互式用户身份验证)。

关于c# - 如何用C#连接kusto数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63493019/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com