az containerapp create parameter --registry-identity, what is it?

Salam ELIAS 137 Reputation points
2025-02-09T17:12:35.95+00:00

Hi, I am trying to create a containerapp with az cli using the following params

az containerapp create --name aca-az2003 --resource-group $RG1 --environment environmentforacontpps --registry-identity $spID --registry-server acraz2003.azurecr.io --image aspnetcorecontainer:latest --ingress external

I used the $spID that I retrived it with

$spID=$(az identity show --resource-group $rg1 --name uai-az2003 --query principalId --output tsv)

where is the user-assigned identity but getting an error

--registry-identity must be an identity resource ID or 'system' or 'system-environment'

So is identity resource ID means the id for the acr? I did but also erroring

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
528 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TP 102.9K Reputation points
    2025-02-09T19:19:14.2+00:00

    Hi,

    You need to remove the initial $ in order to set the variable. Your code should look similar to below:

    spID=$(az identity show --resource-group $rg1 --name uai-az2003 --query principalId --output tsv)
    
    

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.