Closed isakengstrom closed 3 months ago
I managed to fix the problem. It was related to the system managed identity not being configured correctly for the connection string builder. I had misinterpreted kustoConnectionStringBuilder.WithAadSystemManagedIdentity()
to be a setter for a managed identity flag on the builder. But, as the name of the method actually suggests, it's not a setter..
I ended up solving my issue by changing this:
kustoConnectionStringBuilder.WithAadSystemManagedIdentity();
to this:
kustoConnectionStringBuilder = kustoConnectionStringBuilder.WithAadSystemManagedIdentity();
You saved my week!!!
I'm trying to use the Kusto.Data SDK to retrieve data from Azure Data Explorer, through an Azure Function app. I'm able to use the SDK to get data when I run it locally. However, I get the following Kusto client authentication exception when I'm executing the following method
ICslQueryProvider.ExecuteQueryAsync()
in Azure (see full stack trace further down):I'm able to run the same query using the Azure Functions Kusto bindings, both locally and in Azure. I've configured both functions to use System Assigned Managed Identity, and they both use the same connection string.
Connection string format:
Data Source=<DATA_SOURCE_URI>;Fed=true;Accept=true;Authority Id=<TENANT_ID>
Any ideas of what I'm doing wrong?
Sample code, using the Kusto Data SDK
I'm using the following NuGet:
Microsoft.Azure.Kusto.Data 12.1.0
Sample code, using Azure Functions Kusto bindings
I'm using the following NuGet:
Microsoft.Azure.Functions.Worker.Extensions.Kusto 1.0.9-preview
Other specs:
Stack Trace:
line 107 from the stack trace is the following line from the sample code above