【问题标题】:Kusto client failed to send a request to the service: Request headers must contain only ASCII charactersKusto 客户端无法向服务发送请求:请求标头必须仅包含 ASCII 字符
【发布时间】:2019-04-09 09:11:40
【问题描述】:

我正在使用下面的代码来生成一个连接字符串

var kustoUri = $"https://{clusername}.{region}.kusto.windows.net";
var dmKustoUri = $"https://ingest-{clusername}.{region}.kusto.windows.net";

this.engineKustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
    .WithAadApplicationKeyAuthentication(applicationClientId, applicationKey, authority);
this.dmKustoConnectionStringBuilder =
    new KustoConnectionStringBuilder(dmKustoUri)
        .WithAadApplicationKeyAuthentication(applicationClientId, applicationKey, authority);

但是当我运行如下命令时

using (var client = KustoClientFactory.CreateCslAdminProvider(this.engineKustoConnectionStringBuilder))
{
    var command = CslCommandGenerator.GenerateTableCreateCommand(table, columns);

    client.ExecuteControlCommand(command);
}

我不断收到错误消息“Kusto 客户端无法向服务发送请求:请求标头必须仅包含 ASCII 字符。”

我已启用详细跟踪,但我发现它仍在尝试与我的 Azure 用户而不是 AadApplicationKeyAuthentication 连接

这是日志行:

P.RestClient2 信息:0 : ,2019-04-09T08:58:26.1875455Z,P.RestClient2,Information,5CG83138PZ,5CG83138PZ/dotnet/6744,6744,13324,cffdd7bc-7480-4141-a15b-9b6ce1052 cffdd7bc-7480-4141-a15b-9b6ce10523bc,DN-RestClient-ExecuteControlCommand,KD2RunCommand;94b12015-64aa-45a6-b087-b593965673ce,7EB32A3F,"$$HTTPREQUEST[RestClient2]: Verb=POST, Uri=@98765=321@App, dotnet, User=AzureAD\JoeyChömpff, ClientVersion=Kusto.Data:6.2.0-preview;.NET Core 2.0/CLRv4.0.30319.42000/[clr.dll!FileVersion not found], ClientRequestId=KD2RunCommand;94b12015-64aa-45a6 -b087-b593965673ce"

使用的 Nuget 包:

<PackageReference Include="Microsoft.Azure.Kusto.Data.NETStandard" Version="6.1.8" />
<PackageReference Include="Microsoft.Azure.Kusto.Ingest.NETStandard" Version="6.1.8" />

更新:

如果我使用 FullFx 4.7.1 和他们的 NuGetPackages 它可以工作!

  <package id="Microsoft.Azure.Kusto.Data" version="6.1.8" targetFramework="net471" />
  <package id="Microsoft.Azure.Kusto.Ingest" version="6.1.8" targetFramework="net471" />

【问题讨论】:

    标签: c# .net-standard-2.0 azure-data-explorer


    【解决方案1】:

    感谢您报告此事,@JSC。快速浏览一下,我认为这是.NET Framework的HttpClient中HttpClient的行为之间的差距,我们将看看。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-15
      • 2015-06-15
      • 2016-02-27
      • 2015-07-02
      • 2021-11-09
      • 1970-01-01
      • 2017-08-21
      相关资源
      最近更新 更多