0

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
2
  • What is the error showing after command execution. @Ak99mProgrammer Commented Mar 29, 2024 at 5:57
  • Hi! The error showing in Azure portal is Failed Running Status and Pending ImagePullBackOff on legion Commented Mar 29, 2024 at 13:26

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Hey! It is still not working properly. I keep getting the error "  Failed (View details ) 1/1 Pending:ImagePullBackOff on legion" Thank you for your help!
Did you check the image you are trying to execute is proper? @Ak99mProgrammer
Yes! When I do docker pull it works.
But it didnt solve the issue
What is the exact issue you are facing now? @Ak99mProgrammer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.