I'm trying to connect to a kusto cluster I created in azure from Visual Studio 2019, .NET Core 3.1
I'm following this link: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/connection-strings/kusto
This is what I'm doing:
var azureServiceTokenProvider = new AzureServiceTokenProvider();
var accessToken = await azureServiceTokenProvider.GetAccessTokenAsync(clusterUri);
var managedIdentity = "<managed identity>";
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(clusterUri))
.WithAadManagedIdentity(managedIdentity);
But I keep getting this error:
"Exception Message: Tried the following 3 methods to get an access token, but none of them worked."
What am I doing wrong? Is there a simple way to connect to the cluster?