diff --git a/src/azure-cli-core/azure/cli/core/adal_authentication.py b/src/azure-cli-core/azure/cli/core/adal_authentication.py index 4d42159d5f9..68607a820c0 100644 --- a/src/azure-cli-core/azure/cli/core/adal_authentication.py +++ b/src/azure-cli-core/azure/cli/core/adal_authentication.py @@ -21,6 +21,12 @@ class AdalAuthentication(Authentication): # pylint: disable=too-few-public-methods def __init__(self, token_retriever, external_tenant_token_retriever=None): + # DO NOT call _token_retriever from outside azure-cli-core. It is only available for user or + # Service Principal credential (AdalAuthentication), but not for Managed Identity credential + # (MSIAuthenticationWrapper). + # To retrieve a raw token, either call + # - Profile.get_raw_token, which is more direct + # - AdalAuthentication.get_token, which is designed for Track 2 SDKs self._token_retriever = token_retriever self._external_tenant_token_retriever = external_tenant_token_retriever