From 1198dc06fc5c02b959973b9dfda04931b87913f6 Mon Sep 17 00:00:00 2001 From: Jiashuo Li <4003950+jiasli@users.noreply.github.com> Date: Fri, 11 Feb 2022 14:56:29 +0800 Subject: [PATCH] {Core} Discard `tenant_id` in `get_token` (#21244) --- src/azure-cli-core/azure/cli/core/auth/credential_adaptor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/azure-cli-core/azure/cli/core/auth/credential_adaptor.py b/src/azure-cli-core/azure/cli/core/auth/credential_adaptor.py index 01ab8637d39..59e6ad3a426 100644 --- a/src/azure-cli-core/azure/cli/core/auth/credential_adaptor.py +++ b/src/azure-cli-core/azure/cli/core/auth/credential_adaptor.py @@ -56,6 +56,11 @@ def signed_session(self, session=None): def get_token(self, *scopes, **kwargs): logger.debug("CredentialAdaptor.get_token: scopes=%r, kwargs=%r", scopes, kwargs) + + # SDK azure-keyvault-keys 4.5.0b5 passes tenant_id as kwargs, but we don't support tenant_id for now, + # so discard it. + kwargs.pop('tenant_id', None) + scopes = _normalize_scopes(scopes) token, _ = self._get_token(scopes, **kwargs) return token