microsoft.containerregistry/registries' could not be found in subscription

1.6k Views Asked by At

I am geeting the error while I try to attach the Azure Container Registry to the AKS using Visual studio syntax: az aks update --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --attach-acr $ACR_NAME

Error: microsoft.containerregistry/registries' could not be found in subscription

I have logged into the correct subscription and also set the correct subscription

az login --tenant $TENANT_ID
az account set --subscription $SUBSCRIPTION

az acr list also shows me the acr that is created

any possible solution for this?

1

There are 1 best solutions below

0
On

Tested in my environment it is working fine for me, The error you are getting is due to you are looking into wrong subscription. When you use the CLI command az login then you log in with a default subscription. For you, it seems the "Some Other susbscription" is the default. You should check if your registry is in the current subscription. If not, you should set that subscription as the current subscription through the CLI command:

az account set --subscription subscription_id

Now would suggest you to check if the registry exists in current subscription with the CLI command:

az acr show -n acr_name

Also, you can set the subscription in the login time with the parameter --subscription through the CLI command az login.

Reference : az acr - Unable to find repository in case of multiple subscription on single account