0
votes

I am creating azure webapp (multi container app) using CLI. My docker images are in azure container registry(ACR). how do i pass my registry credentials to it or pass some flag that it recognise that images need to be pulled from ACR.

here is my command running from my linux machine (logged in with az login)

az webapp create --resource-group RishiCTS --plan rishi-kpi --name rishi-models --multicontainer-config-type compose --multicontainer-config-file docker-compose-models.yml

update: In azure portal I can pass docker-compose and select image source as ACR, but this start only first service from docker-compose.

1

1 Answers

0
votes

You just need to set the image in the YAML like this:

image: myregistry.azurecr.io/image:tag

Then the Web App will pull the image from your Container Registry. You can take a look at the example for multiple containers. And then you need to add the credential of the ACR with the environment variables:

  • DOCKER_REGISTRY_SERVER_USERNAME - The username for the ACR server.
  • DOCKER_REGISTRY_SERVER_URL - The full URL to the ACR server. (For example, https://my-server.azurecr.io.)
  • DOCKER_REGISTRY_SERVER_PASSWORD - The password for the ACR server.

More details here.