An Azure machine learning service for building and deploying models.
A 401 during image pull and model download in an online endpoint usually points to an authorization problem first, with networking as a secondary possibility.
Based on the failure details:
- The image pull path is failing at registry token exchange.
- The log shows
exchange refresh token return non-success status: 401. - For online deployments, Azure uses managed identities to access the container registry and storage.
- When the endpoint uses a user-assigned identity, that identity must have the required permissions on the backing resources.
- The log shows
- For the container image pull, verify the user-assigned identity has AcrPull on the container registry that stores the environment image.
- The documented requirement for user-assigned identity is AcrPull on the workspace container registry.
- A registry-specific role such as AzureML Registry User is not sufficient for ACR image pull by itself.
- For the model download, verify the same identity has the required storage access.
- The documented requirement is Storage blob data reader on the workspace storage account.
- If MDC is enabled, the requirement changes to Storage Blob Data Contributor.
- Check whether the model and environment artifacts are actually reachable.
- Get deployment logs:
az ml online-deployment get-logs -e <endpoint-name> -n <deployment-name> -l 100 - If model download is failing, verify the model exists in the workspace and check the storage initializer logs:
az ml model show --name <model-name> --version <version>az ml online-deployment get-logs --endpoint-name <endpoint-name> --name <deployment-name> –container storage-initializer
- Get deployment logs:
- Networking can also cause this if the registry is private or otherwise inaccessible.
- The documentation calls out container registry authorization failures when the registry cannot be accessed with the current credentials.
- If the registry is behind a virtual network or private endpoint, verify that the virtual network is set up properly.
- If using legacy network isolation for managed online endpoints, image download failures are expected when public egress is disabled and the registry visibility is private.
- If the endpoint was created with system-assigned identity instead, RBAC is granted automatically. For user-assigned identity, the role assignments must be added manually.
- If the image is not in the expected registry or tag, verify it exists:
az acr repository show-tags -n <acr-name> --repository <repository-name> --orderby time_desc --output table
Most likely fix for this case:
- Add AcrPull to the user-assigned identity on the ACR that backs the environment image.
- Add Storage blob data reader on the storage account that holds the model artifacts.
- If private endpoint or VNet routing is involved, validate that the endpoint can reach the registry and storage paths.
References: