kustos connection string problem in .netcore

落爺英雄遲暮 提交于 2019-12-11 15:29:01

问题


I want to access the kustos without hardcoding password or any application key. It's working perfectly with .net framework. Following is the code.

var serviceName = "help";
var authority = "contoso.com"; // Or the AAD tenant GUID: "..."
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder($"https://{serviceName }.kusto.windows.net")
{
    FederatedSecurity = true,
    InitialCatalog = "samples",
    Authority = authority,
};

However, in dotnet core I get the below error for the same connection string.

  • $exception {"Kusto Connection String Builder has some invalid or conflicting properties: Specified 'AAD Username password' authentication method has some incorrect properties. Missing: [User ID,Password].. ',\r\nPlease consult Kusto Connection String documentation at https://docs.microsoft.com/en-us/azure/kusto/api/connection-strings/kusto"} Kusto.Data.Exceptions.KustoClientInvalidConnectionStringException

My code is in dotnet core and it will be great if you can give me an alternative.


回答1:


If you’re using .NET Core and want to perform user authentication, please set the following properties on KustoConnectionStringBuilder:

  1. UserID
  2. Password
  3. Federated=true

The .NET Core library doesn’t support prompting users for their credentials, so this needs to be provided up front.



来源:https://stackoverflow.com/questions/58299279/kustos-connection-string-problem-in-netcore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!