File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/azure-cli-core/azure/cli/core Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -926,7 +926,9 @@ def _create_subscription_client(self, credential):
926926 raise CLIInternalError ("Unable to get '{}' in profile '{}'"
927927 .format (ResourceType .MGMT_RESOURCE_SUBSCRIPTIONS , self .cli_ctx .cloud .profile ))
928928 api_version = get_api_version (self .cli_ctx , ResourceType .MGMT_RESOURCE_SUBSCRIPTIONS )
929- sdk_cred = CredentialAdaptor (credential )
929+
930+ # MSIAuthenticationWrapper already implements get_token, so no need to wrap it with CredentialAdaptor
931+ sdk_cred = credential if hasattr (credential , 'get_token' ) else CredentialAdaptor (credential )
930932 client_kwargs = _prepare_mgmt_client_kwargs_track2 (self .cli_ctx , sdk_cred )
931933 client = client_type (sdk_cred , api_version = api_version ,
932934 base_url = self .cli_ctx .cloud .endpoints .resource_manager ,
You can’t perform that action at this time.
0 commit comments