Azure / azure-kusto-dotnet

Azure Data Explorer (Kusto) SDK for .NET
MIT License
6 stars 3 forks source link

UtilsKeyNotFoundException: 'Key value 'embedded managed identity' #1

Closed cataggar closed 1 year ago

cataggar commented 2 years ago

I wanted to be able to say to use system managed identity in the connection string, but it does not work. The workaround is to call .WithAadSystemManagedIdentity() to set it. Why can't this be set directly in the connection string?

Kusto.Cloud.Platform.Utils.UtilsKeyNotFoundException: 'Key value 'embedded managed identity' (indicating 'Keyword') was not found in collection 'KustoConnectionStringBuilder keywords''

Steps to reproduce:

            var a = new KustoConnectionStringBuilder("https://help.kusto.windows.net/Samples; Fed=true; Accept=true");
            var b = new KustoConnectionStringBuilder(a.ToString());
            b = b.WithAadSystemManagedIdentity();
            var c = new KustoConnectionStringBuilder(b.ToString());

Tested on Microsoft.Azure.Kusto.Data version 9.2.0 & latest 9.3.1.

cataggar commented 2 years ago

The documentation at https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/connection-strings/kusto does also not quite match regarding the spaces in the property name.

vladikbr commented 2 years ago

@cataggar, system-assigned MI is intentionally not supported as part of a connection string for security reasons (to block any option of tricking the service to perform cross-cluster queries using the service identity).

WRT whitespace, we will look into this.