Skip to content

az acr build doesn't support new ACR with ABAC and a suffix in its login server name #31605

@xi4n

Description

@xi4n

Describe the bug

First of all the whole documentation in general of az acr is not very clear about the new ACRs with a system assigned random suffix in its login server name. For instance, as a user, let's say my ACR name is myacr, the login server is myacr-randomsuffix.azurecr.io, why I as a user can log in with az acr login --name myacr, but a GitHub service principal cannot (it gets "The resource with name 'XXXXX' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'XXXXXXX'"), so that it muse use az acr login --name myacr --suffix randomsuffix to succeed. Which is fine for me.

However, in az acr build this problem comes again. There, there's even no parameter --suffix and without which, the command in GitHub workflow will fail (similar error message).

What should we do here?

Related command

az acr build -r myacr -t myimage . -- wrong
az acr build -r myacr-randomsuffix -t myimage . -- wrong
az acr build -r myacr-randomsuffix.azurecr.io -t myimage . -- wrong again.
So where's the equivalent command to az acr login, with --suffix?

Errors

"The resource with name 'myacr' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'XXXXXXX'"

Issue script & Debug output

See above

Expected behavior

That whether there's a parameter --suffix in az acr build, or, to make it work by omitting the suffix (I still don't see why there's the difference between a human user (which doesn't need to add --suffix in az acr login and a service principal, which needs it)).

Environment Summary

Not really relevant, it's the GitHub Workflow Ubuntu 22.04 or 24.04.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botContainer Registryaz acrService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions