Search code examples
azureazure-cliazure-machine-learning-service

Azure Machine Learning - Use personal container registry


I tried to run this code to create an ml workspace from the azure-ml-cli, referencing an existing azure container registry from another subscription:

az ml workspace create --workspace-name "test-mlws" --keyvault "<key-vault-service-id>" --container-registry "<container-registry-zervice-id>" --location westeurope

The deploy failed with this error code:

{'code': 'InternalServerError', 'message': 'Received 403 from a service request'}

I can't find any documentation about it, and I guess it's due to the container registry I used which belongs to another subscription. Anyone who knows if it's mandatory for the registry to be in the same subscription?


Solution

  • From https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-workspace?tabs=python#limitations

    If you want to use existing services from a different Azure subscription than the workspace, you must register the Azure Machine Learning namespace in the subscription that contains those services.

    So, in order to use the ACR in that different subscription, you need to register resource provider Microsoft.MachineLearningServices in that subscription contains ACR. For information on how to see if it is registered and how to register it, see the Azure resource providers and types article.

    To register a resource provider, use:

    Register-AzResourceProvider -ProviderNamespace Microsoft.MachineLearningServices
    

    To see information for a particular resource provider, use:

    Get-AzResourceProvider -ProviderNamespace Microsoft.MachineLearningServices