Connection errors when connecting locally from VSC to Azure ML via MLflow tracking server

G. Rietbroek 0 Reputation points
2023-05-08T18:04:55.5866667+00:00

I'm experiencing problems when following the basic instructions from Azure ML docs to work locally on Python notebooks and track them in Azure ML via MLflow.

I'm using a conda environment, it's activated and used as kernel in VSC.

All modules from the docs are installed.

I also have the config.json file in the same folder as the notebook.

Azure ML standard workspace is selected in VSC (I think authentication is also okay, because i can see the whole menu tree from Azure ML in VSC)

I'm on a Mac

https://learn.microsoft.com/en-us/azure/machine-learning/how-to-use-mlflow-configure-tracking?view=azureml-api-2&tabs=cli%2Cmlflow

https://learn.microsoft.com/en-us/azure/machine-learning/how-to-use-mlflow-cli-runs?view=azureml-api-2&tabs=interactive%2Ccli

When running the follow code:

from azure.ai.ml import MLClient

from azure.identity import DefaultAzureCredential

ml_client = MLClient.from_config(credential=DefaultAzureCredential())

mlflow_tracking_uri = ml_client.workspaces.get(ml_client.workspace_name).mlflow_tracking_uri

I get this error:

DefaultAzureCredential failed to retrieve a token from the included credentials. Attempted credentials: EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured. Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot.this issue.

And further on:

Content: {"error":"invalid_grant","error_description":"AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2020-10-29T05:28:47.8757835Z and was inactive for 90.00:00:00.\r\nTrace ID: 3f2221fa-0d29-4934-893e-72c565a44a00\r\nCorrelation ID: dc908d2c-927e-4c55-a605-8e36bfcd0467\r\nTimestamp: 2023-05-08 14:41:48Z","error_codes":[700082],"timestamp":"2023-05-08 14:41:48Z","trace_id":"3f2221fa-0d29-4934-893e-72c565a44a00","correlation_id":"dc908d2c-927e-4c55-a605-8e36bfcd0467","error_uri":"https://login.microsoftonline.com/error?code=700082"} To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.

Thereafter I just set the tracking URI by copying it from the workspace. Then when running:


mlflow_tracking_uri = 'azureml://westeurope.api.azureml.ms/mlflow/v1.0/subscriptions/bb026f63-bb96-4a45-9ab1-aed3ded1f99e/resourceGroups/OSAP-Student-Env/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace'

import mlflow

mlflow.set_tracking_uri(mlflow_tracking_uri)

mlflow.set_experiment(experiment_name='experiment_with_mlflow')

I get this error:

UnsupportedModelRegistryStoreURIException: Model registry functionality is unavailable; got unsupported URI 'azureml://westeurope.api.azureml.ms/mlflow/v1.0/subscriptions/bb026f63-bb96-4a45-9ab1-aed3ded1f99e/resourceGroups/OSAP-Student-Env/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace' for model registry data storage. Supported URI schemes are: ['', 'file', 'databricks', 'databricks-uc', 'http', 'https', 'postgresql', 'mysql', 'sqlite', 'mssql']. See https://www.mlflow.org/docs/latest/tracking.html#storage for how to run an MLflow server against one of the supported backend storage locations.

Why is the standard code not working? I really have no clue what's wrong here. Does anybody experienced the same or knows how to solve this issue?

Many thanks for the person(s) who can help me!:)

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,667 questions
{count} votes