问题
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
:
UserID
Password
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