Hi Chris Musselle,
I'm sorry to hear that you're still encountering issues and frustration on it. Based on the error message and the traceback, it seems like the authentication to your private Azure Container Registry (ACR) is failing. I know you have already troubleshooted a few steps. Can you confirm the following steps:
- Verify Role Assignment: Ensure that the Azure Machine Learning (AML) registry identity has the
AcrPull
role assigned on the ACR. You can verify this using the Azure CLI:
az role assignment create --assignee <AML-Registry-Identity-ID> --role AcrPull --scope /subscriptions/<Subscription-ID>/resourceGroups/<Resource-Group-Name>/providers/Microsoft.ContainerRegistry/registries/<ACR-Name>
- Check Managed Identity: Make sure that the managed identity used by the AML registry has the necessary permissions. If you are using a system-assigned managed identity, ensure it has the
AcrPull
role on the ACR. - Update Authentication Method: If you are using the Azure ML Python SDK, ensure that you are using the
DefaultAzureCredential
for authentication. This credential will automatically handle the authentication process for you. Here is an example:
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
from azure.ai.ml.entities import Environment
credential = DefaultAzureCredential()
ml_client = MLClient(
credential=credential,
subscription_id="<Subscription-ID>",
resource_group_name="<Resource-Group-Name>",
registry_name="<AML-Registry-Name>"
)
env_name = "my-custom-env"
env = Environment(
name=env_name,
description="Environment with custom Docker image",
image="<ACR-Name>.azurecr.io/<Image-Name>:<Tag>",
conda_file="path/to/conda.yml"
)
ml_client.environments.create_or_update(env)
- Check Docker Image URL: Verify that the Docker image URL is correctly formatted and accessible. The URL should be in the format
<ACR-Name>.azurecr.io/<Image-Name>:<Tag>
. - Disable Local Auth: If you have local authentication enabled for your ACR, consider disabling it and using managed identities instead. This can help avoid issues related to credential management.
- Firewall and Network Configuration: Ensure that your ACR is not behind a firewall or virtual network that might be blocking access from the AML registry. If it is, you need to configure the firewall settings to allow access from the AML workspace.
If you have followed these steps and are still encountering issues, please provide more the latest details about your setup, including any additional error messages or logs. This will help in diagnosing the problem further.
For more detailed information, you can refer to the official documentation
Thanks