skip to content
Alvin Lucillo

Set app container settings with image and registry url

/ 1 min read

Yesterday, we set the app to use the managed identity when connecting to ACR. Now, we set the container settings to the container image and registry URL. When the app tries to pull the image, it will use its managed identity to pull the specified image with the specified ACR URL.

az webapp config container set \
    --resource-group $RESOURCE_GROUP \
    --name $APP_NAME \
    --container-image-name $ACR_NAME.azurecr.io/docprocessor:v1 \
    --container-registry-url https://$ACR_NAME.azurecr.io
No credential was provided to access Azure Container Registry. Trying to look up...
Retrieving credentials failed with an exception:'Failed to retrieve container registry credentials. Please either provide the credentials or run 'az acr update -n <registry> --admin-enabled true' to enable admin first.'
[
  {
    "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
    "slotSetting": false,
    "value": "false"
  },
  {
    "name": "DOCKER_REGISTRY_SERVER_URL",
    "slotSetting": false,
    "value": "https://<registry>.azurecr.io"
  },
  {
    "name": "DOCKER_CUSTOM_IMAGE_NAME",
    "value": "DOCKER|<registry>.azurecr.io/docprocessor:v1"
  }
]