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?
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 adefault
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:Now would suggest you to check if the registry exists in current subscription with the CLI command:
Also, you can set the subscription in the login time with the parameter
--subscription
through the CLI commandaz login
.Reference : az acr - Unable to find repository in case of multiple subscription on single account