azuredns: use TenantID also for cli authentication (#2176)

This commit is contained in:
Orgad Shaneh 2024-05-07 21:56:05 +03:00 committed by GitHub
parent 983c181e45
commit 2ec9e42ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,7 +213,11 @@ func getCredentials(config *Config) (azcore.TokenCredential, error) {
return &timeoutTokenCredential{cred: cred, timeout: config.AuthMSITimeout}, nil
case "cli":
return azidentity.NewAzureCLICredential(nil)
var credOptions *azidentity.AzureCLICredentialOptions
if config.TenantID != "" {
credOptions = &azidentity.AzureCLICredentialOptions{TenantID: config.TenantID}
}
return azidentity.NewAzureCLICredential(credOptions)
case "oidc":
err := checkOIDCConfig(config)