From 23444103c676434b8c7c49517edb22f688aa5ab3 Mon Sep 17 00:00:00 2001 From: yueluhuan Date: Sun, 25 Dec 2022 02:05:19 +0000 Subject: [PATCH] fix --- kusto/kcsb.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kusto/kcsb.go b/kusto/kcsb.go index 0d5be2bf..115a7ece 100644 --- a/kusto/kcsb.go +++ b/kusto/kcsb.go @@ -2,11 +2,12 @@ package kusto import ( "fmt" + "strconv" + "strings" + kustoErrors "github.com/Azure/azure-kusto-go/kusto/data/errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "strconv" - "strings" ) type ConnectionStringBuilder struct { @@ -356,7 +357,7 @@ func (kcsb *ConnectionStringBuilder) newTokenProvider() (*TokenProvider, error) return cred, nil } case kcsb.MsiAuthentication: - { + init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { opts := &azidentity.ManagedIdentityCredentialOptions{} if kcsb.ClientOptions != nil { opts.ClientOptions = *kcsb.ClientOptions @@ -370,6 +371,8 @@ func (kcsb *ConnectionStringBuilder) newTokenProvider() (*TokenProvider, error) return nil, fmt.Errorf("error: Couldn't retrieve client credentials using Managed Identity: %s", err) } tkp.tokenCred = cred + + return cred, nil } case !isEmpty(kcsb.UserToken): {