Using Azure Batch my task ends seconds after starting, with the error that the container used is invalid?

Tommy Nielsen 0 Reputation points
2025-11-24T07:48:44.6733333+00:00

Not able to use a uploaded Docker image.
The Docker image is tested locally and is able to reach the Azure storage and preform and save back into Azure storage as expected.
But when trying to use the uploaded image to ACR the task is interrupted directly upon start.
With error that one or more containers are invalid.

I am not able to get further information on this when inspecting the node as there are no logs available.
I also have tried to activate logging for Azure Batch but still nothing available in the node outputs?

I have tried to use the container name without version and with :latest or :v2 (current version)

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
{count} votes

2 answers

Sort by: Most helpful
  1. Himanshu Shekhar 1,780 Reputation points Microsoft External Staff Moderator
    2025-11-24T12:09:19.98+00:00

    Hello Tommy Nielsen - Thank you for reaching Microsoft QnA Platform

    Azure Batch must have a ContainerConfiguration on the pool with the right image name and registry and if this is missing or malformed, the pool will reject the task containers as invalid. -https://learn.microsoft.com/en-us/azure/batch/batch-docker-container-workloads

    If the node cannot authenticate to ACR, container creation can fail with generic container invalid type errors.

    Managed Identity: (https://stackoverflow.com/questions/79520277/azure-batch-pool-with-acr-fails-to-fetch-image)

    1. Please create a User-Assigned Managed Identity (UAMI).
    2. On the ACR, please grant that UAMI at least the AcrPull role (IAM > Add role assignment > as AcrPull).​
    3. On the Batch account, enable Identity and attach the same UAMI.​
    4. In the pool’s Container configuration please specify the registry with identity-based auth Portal will show a “Managed identity” / “User-assigned identity” reference.
    5. Enable ACR admin account (under Access keys), copy username and password. In pool Container configuration > Container registries set: Registry server: myregistry.azurecr.io (e.g) Username: ACR admin user (e.g) Password: ACR admin password. (e.g)​

    A malformed task container setting can also cause container invalid.​

    please try to check on the job/task:

    Task > Container settings: Here image name matches exactly what is configured/prefetched on the pool, e.g. myregistry.azurecr.io/myrepo/myimage:v2.

    Note: please do not omit the registry prefix or tag if your pool prefetches a specific tag.

    For enable Batch diagnostics logging to a Storage account on the Batch account - https://learn.microsoft.com/en-us/azure/batch/best-practices#attaching-and-preparing-data-disks

    0 comments No comments

  2. Tommy Nielsen 0 Reputation points
    2025-11-24T13:39:38.75+00:00

    Hi
    Thanks for your help
    I found that the issue was that i only used the name of the container like myimage:v2

    and not the full path myregistry.azurecr.io/myimage:v2.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.