Skip to content

[Bug] msal==1.29.0 incompatible with azureml-core<1.55 #719

@hutec

Description

@hutec

Describe the bug

AzureML authentication through AzureML SDK v1 fails when using msal==1.29.0 and azureml-core==1.54.0.post1.

To Reproduce

from azureml.core import Workspace, Dataset

workspace = Workspace.from_config()
dataset = Dataset.get_by_name(workspace, "Dataset", "latest")

This example works with msal==1.28.1 and fails with msal==1.29.0.

Expected behavior
Dataset should be retrieved.

What you see instead

Performing interactive authentication. Please follow the instructions on the terminal.
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code GE3R845WZ to authenticate.
Traceback (most recent call last):
  File "minimal.py", line 3, in <module>
    workspace = Workspace.from_config()
  File "/usr/local/lib/python3.8/dist-packages/azureml/core/workspace.py", line 292, in from_config
    return Workspace.get(
  File "/usr/local/lib/python3.8/dist-packages/azureml/core/workspace.py", line 605, in get
    auth = InteractiveLoginAuthentication()
  File "/usr/local/lib/python3.8/dist-packages/azureml/core/authentication.py", line 571, in __init__
    perform_interactive_login(tenant=tenant_id, cloud_type=self._cloud_type)
  File "/usr/local/lib/python3.8/dist-packages/azureml/_base_sdk_common/common.py", line 573, in perform_interactive_login
    subscriptions = profile.login(
  File "/usr/local/lib/python3.8/dist-packages/azureml/_vendor/azure_cli_core/_profile.py", line 177, in login
    subscriptions = subscription_finder.find_using_common_tenant(username, credential)
  File "/usr/local/lib/python3.8/dist-packages/azureml/_vendor/azure_cli_core/_profile.py", line 769, in find_using_common_tenant
    specific_tenant_credential = identity.get_user_credential(username)
  File "/usr/local/lib/python3.8/dist-packages/azureml/_vendor/azure_cli_core/auth/identity.py", line 182, in get_user_credential
    return UserCredential(self.client_id, username, **self._msal_app_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/azureml/_vendor/azure_cli_core/auth/msal_authentication.py", line 43, in __init__
    raise AzureMLException("User {} does not exist in MSAL token cache. Run `az login`.".format(username))
azureml._common.exceptions.AzureMLException: AzureMLException:
        Message: User ********** does not exist in MSAL token cache. Run `az login`.
        InnerException None
        ErrorResponse 
{
    "error": {
        "message": "User ********* does not exist in MSAL token cache. Run `az login`."
    }
}

The MSAL Python version you are using

The example works with msal==1.28.1 and fails with msal==1.29.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions