Authentication fails using mlflow
Hi,
I'm really new to azureml and I am trying to run some experiments using a remote compute cluster. I want to use mlflow to download files and check on jobs like so:
mlflow.set_tracking_uri(tracking_uri)
mlflow.set_experiment(experiment_name='my_experiment')
on this page they mention it will use "Interactive Authentication and hence no further action is required". But I always get the following error without any interactive authentication:
ChainedTokenCredential 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.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: Azure Active Directory error '(invalid_grant) AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2022-05-03T08:25:15.3234957Z and was inactive for 90.00:00:00.
Trace ID: 28dd8b29-7acc-486e-ac2c-df6ebfda4800
Correlation ID: 3fcc2282-4e5a-4fee-b08c-50b59d253ca9
Timestamp: 2023-03-24 14:29:54Z'
I am not really sure what to do. I tried setting the environment variables like below, by registering the mlflow_uri I found in the workspace to azureAD and creating a client secret but this gave me a error:403.
os.environ["AZURE_TENANT_ID"] = "<AZURE_TENANT_ID>"
os.environ["AZURE_CLIENT_ID"] = "<AZURE_CLIENT_ID>"
os.environ["AZURE_CLIENT_SECRET"] = "<AZURE_CLIENT_SECRET>"
can't figure out what I'm doing wrong. Any suggestions?
Hi @TimonDaniels, thank you for opening an issue! The 403 error that you're seeing when attempting environment variable authentication means that the variables are being picked up, but authentication with the provided information failed.
I'm not sure what mlflow attempts to authenticate with so I unfortunately can't provide much more help, but I'll tag some folks from ML who can get back to you as soon as possible. cc @azureml-github
Hi @TimonDaniels, thank you for opening an issue! The 403 error that you're seeing when attempting environment variable authentication means that the variables are being picked up, but authentication with the provided information failed.
I'm not sure what
mlflowattempts to authenticate with so I unfortunately can't provide much more help, but I'll tag some folks from ML who can get back to you as soon as possible. cc @azureml-github
Thanks!
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github, @Azure/azure-ml-sdk.
Issue Details
Hi,
I'm really new to azureml and I am trying to run some experiments using a remote compute cluster. I want to use mlflow to download files and check on jobs like so:
mlflow.set_tracking_uri(tracking_uri)
mlflow.set_experiment(experiment_name='my_experiment')
on this page they mention it will use "Interactive Authentication and hence no further action is required". But I always get the following error without any interactive authentication:
ChainedTokenCredential 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.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: Azure Active Directory error '(invalid_grant) AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2022-05-03T08:25:15.3234957Z and was inactive for 90.00:00:00.
Trace ID: 28dd8b29-7acc-486e-ac2c-df6ebfda4800
Correlation ID: 3fcc2282-4e5a-4fee-b08c-50b59d253ca9
Timestamp: 2023-03-24 14:29:54Z'
I am not really sure what to do. I tried setting the environment variables like below, by registering the mlflow_uri I found in the workspace to azureAD and creating a client secret but this gave me a error:403.
os.environ["AZURE_TENANT_ID"] = "<AZURE_TENANT_ID>"
os.environ["AZURE_CLIENT_ID"] = "<AZURE_CLIENT_ID>"
os.environ["AZURE_CLIENT_SECRET"] = "<AZURE_CLIENT_SECRET>"
can't figure out what I'm doing wrong. Any suggestions?
| Author: | TimonDaniels |
|---|---|
| Assignees: | luigiw |
| Labels: |
|
| Milestone: | - |
I"m experiencing the identical issue trying to connect a local notebook session to mlflow server. I tried to find where to setup the tenant id/client key/secret and couldn't find how to do that without registering an app service which seemed wrong. Can provide more details if needed but essentially identical behaviour as @TimonDaniels and would like to get this up and running ASAP.
I have the same problem, according to the information here it should work with Interactive or even AzureCli credentials, but the list of credentials attempted in the ChainedTokenCredential does not match the list here...
This works when running from an Azure ML compute but fails from my local laptop.
Is there any update on this?
Sorry for the delay in addressing this one. I will assign this issue to our MLFlow issue owner and they will investigate.
We're looking into this and will get back to you as soon as possible.
Any update on this?
Sorry, its causing delay but we are working on it and will get back to you as soon as possible.
I tried to reproduce the problem but unable to do so. I was able to connect to the workspace. I would suggest few solutions given below to connect to azure ml studio.
- Try other login methods like -Use ml client and run command
az loginand then run the code. Installing ml client - When you create workspace make sure you have right authorization - link
- Use latest version of mlflow and azureml-mlflow
I ran following code in order to create experiment on azure ml studio.
import mlflow
mlflow.set_tracking_uri("Get this URL from ml studio")
experiment_name = 'experiment_with_mlflow2'
mlflow.set_experiment(experiment_name)
mlflow.create_experiment(experiment_name)
If this does not help please elaborate the steps, code you are running.
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Closing the issue due to no response