From 2ec9e42ee3f244769e71da71ddffef6f9d871fbf Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 7 May 2024 21:56:05 +0300 Subject: [PATCH] azuredns: use TenantID also for cli authentication (#2176) --- providers/dns/azuredns/azuredns.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/dns/azuredns/azuredns.go b/providers/dns/azuredns/azuredns.go index 05c1788b35..bd87d9506d 100644 --- a/providers/dns/azuredns/azuredns.go +++ b/providers/dns/azuredns/azuredns.go @@ -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)