Azure / azureml-examples

Official community-driven Azure Machine Learning examples, tested with GitHub Actions.
https://docs.microsoft.com/azure/machine-learning
MIT License
1.76k stars 1.44k forks source link

Creating an AzureML environment with a base image from a private repository and publishing to registry fails #3420

Open OriolVF opened 1 month ago

OriolVF commented 1 month ago

Operating System

Windows

Version Information

azure-cli: 2.65.0 azure-cli-core: 2.65.0 azure-cli-telemetry: 1.1.0 extensions: acrquery: 1.0.1 ml: 2.31.0

Steps to reproduce

  1. Generate a yaml environment definition:
    $schema: https://azuremlschemas.azureedge.net/latest/environment.schema.json name: uritomltable-environment image: myacr.azurecr.io/azuremlbuild/myimage:1 description: Environment created from a Docker image version: 1
  2. Verify authentication to registry: User can do acr login and docker pull myacr.azurecr.io/azuremlbuild/myimage:1 (authentication works)
  3. Create the environment on a registry running az ml environment create --file myenv.yml --registry-name MyRegistry

Expected behavior

Environment is created and pushed to registry. Authentication should work if the user/service principal has rights to the acr and registries. Extra taken steps:

Actual behavior

Error is returned : Authentication failed for container registry myacr. Code: UserError

Addition information

When trying to publish the environment to a workspace it works fine. When trying to publish an environment to the registry with an image from an open registry (for example pytorch) it works fine.