I had the same issue, and I followed/checked everything in this thread.
- Provider was registered
- Created the ACR
- Visible in portal
- Not visible by az cli In my case, I have to just wait for 10 -15 minutes for it to work as expected.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
Please note that I am the owner of this subscription.
I had the same issue, and I followed/checked everything in this thread.
Hello Sushell!
1 - Can you try to run "az acr list -o table" and see if that displays your ACR?
2 - Can you try to add "--subscription <subscription-id>" next to "az acr show" or "az acr list" or run "az account set --subscription <subscription-id>"?
3 - Can you try to run the same commands from Cloud Shell in order to attempt isolating the issue and understand if it is something general or related to your terminal?
If these suggestions helped you address the issue, please "Accept as Answer" and Upvote if it helped, so that it can help others in the community looking for help on similar topics.
Thank you!
Adding to this as I came across this same issue. Was able to az acr login to my ACR but couldn't actually do the az acr import that I wanted.
Turns out I was missing ACR level permissions for my managed identity. Not sure exactly what permissions are required. But the Contributor role fixed the issue. However, merely having the ACR Push role was not up to the task.
Initial setup:
az login -i //I'm using a managed Identity on a self-hosted build agent
az account set --subscription <subscription id>
az acr list -o table
<Nothing here, results were an empty line>
After adding the Contributor Role on top of ACR Push I reran and got
NAME RESOURCE GROUP LOCATION SKU LOGIN SERVER CREATION DATE ADMIN ENABLED
MyACR MyResourceGroup region Premium myacr.azurecr.io 2024-04-14T04:30:29Z False
Hope this helps you in your effort to fix this.
I had a similar issue trying to use the ACRPush role for an import.
The docs have a new custom role that you can create to give the correct import permissions now.
{
"assignableScopes": [
"/subscriptions/<optional, but you can limit the visibility to one or more subscriptions>"
],
"description": "Can import images to registry",
"Name": "AcrImport",
"permissions": [
{
"actions": [
"Microsoft.ContainerRegistry/registries/push/write",
"Microsoft.ContainerRegistry/registries/pull/read",
"Microsoft.ContainerRegistry/registries/read",
"Microsoft.ContainerRegistry/registries/importImage/action"
],
"dataActions": [],
"notActions": [],
"notDataActions": []
}
],
"roleType": "CustomRole"
}