Error while creating container using yml file(Container group with multiple containers)

Prabhu Kuttalam 21 Reputation points
2020-06-12T11:03:00.48+00:00

Hi Team,

I tried to create multiple container group with yml file as per the below tutorial

https://learn.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-yaml

I created the resource group as per the tutorial and
when running the command "az container create --resource-group ksprabhu65grp --file deploy-aci.yml" , I am getting the below error

"Multiple error occurred: 'BadRequest':'InaccessibleImage':'The image 'ksprabhu50registry.azurecr.io/wstep50:latest' in container group 'ksprabhu65grp' is not accessible. Please check the image and registry credential.';'BadRequest':'InaccessibleImage':'The image 'ksprabhu50registry.azurecr.io/jstep50:latest' in container group 'ksprabhu65grp' is not accessible. Please check the image and registry credential.
"
I used the below property in yml file to access the image

imageRegistryCredentials:

  • server: login sever
    username: <username for registry>
    password: <password for registry>

Note: I am using powershell for ther runs

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
635 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Kavya Gangoor 6 Reputation points
    2021-03-10T12:52:31.137+00:00

    In your yaml file, you need to add the imageRegistryCredentials in the correct place under properties.
    For reference take the below example. Here I have shown the location where imageRegistryCredentials has to be placed.
    Hope this solves your problem.

    apiVersion: 2019-12-01
    location: eastus
    name: securetest
    properties:
    imageRegistryCredentials:

    • server: imageRegistryLoginServer
      username: imageRegistryUsername
      password: imageRegistryPassword
      containers:
    • name: mycontainer
      properties:
      environmentVariables:
    • name: 'NOTSECRET'
      value: 'my-exposed-value'
    • name: 'SECRET'
      secureValue: 'my-secret-value'
      image: <container-registry-image>
      ports: []
      resources:
      requests:
      cpu: 1.0
      memoryInGB: 1.5
      osType: Linux
      restartPolicy: Always
      tags: null
      type: Microsoft.ContainerInstance/containerGroups
    2 people found this answer helpful.
    0 comments No comments

  2. Andrei-Radu Cristescu 6 Reputation points
    2020-12-01T10:06:39.34+00:00

    I agree with the original poster, it doesn't seem possible to execute a docker compose with custom images from the Azure Image Registry. Even if I pass the username and password as command line arguments, I still get the same error message:

    BadRequestError: The image '<my_registry_name>.azurecr.io/<my_image_name>' in container group '<my_container_group_name>' is not accessible. Please check the image and registry credential.

    I've also tried logging in my local Azure CLI, using the commands "az acr login --name <my_name>" and also "docker login". The login itself was successful, but when I execute docker compose, I still get the same error message as above.

    1 person found this answer helpful.

  3. prmanhas-MSFT 17,886 Reputation points Microsoft Employee
    2020-07-02T09:16:02.407+00:00

    @Prabhu Kuttalam Apologies for the delay in response.

    Azure Content Registry (ACR) provides several ways to authenticating to pull or push images. All the mechanism can be seen here .

    ACR provides easier way to authenticate with AKS which is explained in this article. Since you have already setup AKS cluster, look at the section "Configure ACR integration for existing AKS clusters" of documentation. Once you enable AKS to access ACR, you do not need to provide credentials credentials in the yaml file.

    Hopefully this should solve the problem.

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics

    0 comments No comments

  4. Miller, Greg 1 Reputation point
    2021-07-13T21:32:23.363+00:00

    I am also running into the same issue with a service principal (with arc push/pull) on ContainerInstance/containerGroups

    0 comments No comments

  5. Jeison Londono 1 Reputation point
    2021-12-26T20:19:37.31+00:00

    Hello,

    I'm having the same issue, no matter what authentication method I use, I always get the same error. Even if I try to deploy it from Azure UI Console.

    Can someone please help to find a way to deploy a multi-container to a container group?

    0 comments No comments