我正在尝试使用 C# 建立与 Azure DataExplorer 群集的连接。我在https://docs.microsoft.com/en-us/azure/kusto/api/netfx/about-kusto-data中引用了 C# 并安装了 nuget在visual studio中打包kusto.data并复制代码并在cmd提示符下运行dotnet,但它不起作用。
下面是我的代码-
using Microsoft.Azure.Management.Kusto;
using System;
namespace LensDashboradOptimization
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
//var clusterUrl = "https://masvaas.kusto.windows.net";
//var kcsb = new Kusto.Data.KustoConnectionStringBuilder(clusterUrl);
//Console.WriteLine(kcsb);
// 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.
var client = Kusto.Data.Net.Client.KustoClientFactory.CreateCslQueryProvider("https://masvaas.windows.net/Samples;Fed=true");
var reader = client.ExecuteQuery("MyTable | count");
Console.WriteLine(reader);
}
}
}
我都试过了fed=true
,WithAadUserPromptAuthentication();
都没有用。我错过了什么吗?