Share via

How to access an image when setting up a container group via Azure CLI

Andrea Glatthor 21 Reputation points
2022-12-30T09:00:26.53+00:00

I'm following this How-To guide:
https://learn.microsoft.com/en-us/azure/container-instances/container-instances-container-group-ssl

In the deploy-aci.yaml I need to replace the image with my own private image (stored in an Azure container registry). The example code is:

  • name: my-app
    properties:
    image: mcr.microsoft.com/azuredocs/aci-helloworld

I tried this:

image: <mycontainerregistryname>.azurecr.io/<myrepositoryname>:<tag>

... and get an error:

The image '...' in container group '...' is not accessible. Please check the image and registry credential.

What is the correct syntax? Do I have to put in the password of the container registry?

Azure Container Registry
Azure Container Registry

An Azure service that provides a registry of Docker and Open Container Initiative images.

Azure Container Instances
0 comments No comments
{count} votes

Answer accepted by question author
  1. Andrei Barbu 2,601 Reputation points Microsoft Employee
    2022-12-30T09:35:11.943+00:00

    Hello @Andrea Glatthor !

    Thank you for raising the question.

    Please refer to the following link to understand how you should set an image from your private container image registry.

    https://learn.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-yaml#configure-a-yaml-file
    https://learn.microsoft.com/en-us/azure/container-instances/container-instances-using-azure-container-registry#deploy-with-azure-resource-manager-template

    "To use a private container image registry, add the imageRegistryCredentials property to the container group, with values modified for your environment:

    imageRegistryCredentials:

    • server: imageRegistryLoginServer
      username: imageRegistryUsername
      password: imageRegistryPassword"

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

    Thank you and happy new year!

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.