【问题标题】:Run Time error in making kusto connection in c# -- AADSTS50079:在 c# 中建立 kusto 连接时出现运行时错误——AADSTS50079:
【发布时间】:2019-12-09 18:09:58
【问题描述】:

“运行时异常 AADSTS50079:由于您的管理员进行了配置更改,或者因为您移动到了新位置,您必须注册多重身份验证”

static void Main(string[] args)
{
  var builder = new 
  KustoConnectionStringBuilder("help.kusto.windows.net/Samples")
     {
        FederatedSecurity = true,
        UserID = "***@microsoft.com",
        Password = "****",
        EnforceMfa = true
     };

     var client = 
     Kusto.Data.Net.Client.KustoClientFactory.CreateCslQueryProvider(builder); 
     var reader = client.ExecuteQuery("StormEvents | count");

    }

【问题讨论】:

标签: c# adal azure-data-explorer


【解决方案1】:

如果您是 microsoft FTE 并尝试在 dotNet Core Console Application 上查询 kusto,我建议您使用 dotNet Framework Console Application。 使用

var client = Kusto.Data.Net.Client.KustoClientFactory.CreateCslQueryProvider("https://help.kusto.windows.net/Samples;Fed=true");
var reader = client.ExecuteQuery("MyTable | count");
// Read the first row from reader -- it's 0'th column is the count of records in MyTable
// Don't forget to dispose of reader when done.

https://docs.microsoft.com/en-us/azure/kusto/api/netfx/about-kusto-data 然后它将弹出一个窗口以使用 VSTS 作为多因素身份验证。 VSTS 认证好像不支持 dotNet Core。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-05
    • 1970-01-01
    相关资源
    最近更新 更多