Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for not found #87

Closed
codingoutloud opened this issue Apr 20, 2018 · 8 comments
Closed

Improve error message for not found #87

codingoutloud opened this issue Apr 20, 2018 · 8 comments
Assignees
Labels

Comments

@codingoutloud
Copy link

When az acr repository list --name myreg is run when myreg is not in the current subscription, the following error is returned:

No resource with type Microsoft.ContainerRegistry/registries can be found with name: myreg

It would be more helpful if the error also mentioned the Subscription in question. For example:

No resource with type Microsoft.ContainerRegistry/registries can be found with name: myreg from Subscription: MySubscription.

This will help users much more quickly understand the source of the problem in cases where this is caused by an incorrect default subscription, a scenario mention on the troubleshooting guide.

@SteveLasker
Copy link
Contributor

@sajayantony is this something we can fix in az acr, or is this in the az cli?

@djyou
Copy link
Member

djyou commented Apr 27, 2018

We fixed the scenario when -g is not specified and the printed message now is

The resource with name 'MyRegistry' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'My Subscription (00000000-0000-0000-0000-000000000000)'.

When -g is specified, the CLI prints message from ARM directly which we don't have control.

@sajayantony
Copy link
Contributor

@djyou - Do we even need to support -g . Is it for scoping? this is repository subgroup.

@djyou
Copy link
Member

djyou commented Apr 27, 2018

-g is just to follow convention, all Azure resources belong to some resource group and ACR is a special case where resource group can be resolved due to it's unique name.

@SteveLasker
Copy link
Contributor

Would really like to see this removed as these are nested resources, and ACR already has global uniqueness. I

@sajayantony
Copy link
Contributor

@djyou can we close this?

@djyou
Copy link
Member

djyou commented Jul 24, 2018

Close as the fix has been merged in.

@djyou djyou closed this as completed Jul 24, 2018
@rtaylor72
Copy link

I ran into this and found another issue. The service provider (SP) I was using only had the "Acr Push" role. I had to add the "Contributor" role to resolve the issue. So it appears "Acr Push" does not have enough permissions to see the ACR resource. Hope this helps someone else that sees this error and is confused knowing that the ACR is in the specified subscription.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants