I am working on a script where I want to run az acr import. The command tries to list the repository but fails with the error: The resource with name 'name' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription
As you can see in the screenshot below. This registry is indeed present in the subscription. I am able to login, run docker push as well which completes successfully. But az acr show returns a failure.

I tried to log in to another Azure subscription and tried running
and received same error code as yours even when the az acr log in command was successfull, refer below:-
When I ran the same commands and logged into the correct subscription where my ACR is deployed, Then I was able to retrieve acr details with
az acr show -n <acr-name>command, Refer below:-I am using sudo before every Azure CLI command to make sure I am running the scripts as a root user.
Scripts:-
Logged into my Azure account:-
Checked if the account is set to the correct subscription as my ACR:-
Logged into ACR:-
Ran the command:-
Make sure you only add Container registry name and not the log in server name in the az acr show - n command.
Output:-
If the issue persists try
az logoutcommand let and try logging in again as your Azure CLI in the ubuntu VM might have cached the credentials.Reference:-
azure - az acr - Unable to find repository in case of multiple subscription on single account - Stack Overflow