Azure Container App :ImagePullBackOff on legion when using Private image from Azure Container Registry

52 Views Asked by At

enter image description here Hello! I am new to Azure Container Registries and Azure Container apps. I am trying to create a container app using a private image in ACR. My ACR has admin user turned on for a username and password. I also have a managed identity with the proper permissions like ACRPull.

Inside I have a flask app listening to port 5000

However, I cant seem to get it working. Thank you for your help.

I tried using the portal and AZ Cli running commands like:

az containerapp create --name $CONTAINER_APP_NAME --resource-group $RESOURCE_GROUP --environment $CONTAINER_APP_ENVIRONMENT --image $IMAGE --target-port 5000 --ingress 'external' --registry-server $REGISTRY_SERVER  --registry-username $ACR_USERNAME  --registry-password $ACR_PASSWORD --user-assigned $IDENTITY_ID --query configuration.ingress.fqdn
1

There are 1 best solutions below

5
Jahnavi On

As you are already using managing identity for authentication purpose, there is no need of including credentials like ACR username and password in your script again.

Image attribute should contain the below format.

--image $_REGISTRY_NAME.azurecr.io/$IMAGE_NAME:$IMAGETAG

To create a container app with private container image, following parameters are required along with the az containerapp create CLI command.

az containerapp create --name "newcont" --resource-group "xxx" --environment "MyContainerappEnvironment" --image "nginx" --target-port 5000 --ingress 'external' --user-assigned "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userj" --query properties.configuration.ingress.fqdn

Creating app environment with CLI command:

az containerapp env create -n <Name> -g xxx --location eastus2

enter image description here

enter image description here

To check the creation status of a container app, use az containerapp show CLI command.