Azure/acr

GitHub Actions: ACR rejects valid 'repository:tag' parttern

Closed this issue · 1 comments

Describe the bug
We use GitHub Actions at my org, and one of the jobs involves building images, and pushing them to our ACR.

I'm running the following two commands after successfully authenticating via az login.

az acr build --registry $ACR_REGISTRY --image $ACR_PATH:react-latest --file app/Dockerfiles/Dockerfile.prod app

az acr build --registry $ACR_REGISTRY --image $ACR_PATH:express-latest --file server/Dockerfiles/Dockerfile.prod server

$ACR_REGISTRY is the name of our registry
$ACR_PATH is the name of the repository inside the registry that we want to push these images to.

To Reproduce
Steps to reproduce the behavior:
Let's call $ACR_PATH my_repository and set that value as a secret in GitHub Actions settings, making it available to the Action via the env block in my yaml.

Running the pipeline, I'm told

Message: Some of the properties of 'runRequest' are invalid.. InnerErrors: DockerBuildRequest:Image name '***:react-latest' is invalid. 
The acceptable patterns are 'repository' or 'repository:tag'.The repository and tag names follow the standardized docker repository and tag naming conventions. Tag templates are supported within '{{' and '}}'. 
Please refer to docs for more information on using image name and tag:  https://aka.ms/az/acr/az-acr-build
Target: request
Exception Details:	(InvalidImageString) Image name '***:react-latest' is invalid. 

To be clear, ***:react-latest evaluates to my_repository:react-latest, which is a registry I want to create, and push the image to.

Expected behavior
Unfortunately this error has come out of nowhere. I run and operate about a dozen other pipelines exactly the same way, and so I've either completely forgot how to set $ACR_PATH, or something else is going on.

Any relevant environment information

  • OS: [e.g. Ubuntu, Windows]: self-hosted GitHub runners, I believe Debian
  • Azure CLI/PowerShell/SDK version: Whatever version is shipped in the actions/checkout@v3 action
  • Datetime (UTC) when the issue occurred: 7PM MST
  • Registry and image names: Established via GitHub Actions secrets

Additional context
Add any other context about the problem here.

If any information is a concern to post here, you can create a support ticket or send an email to acrsup@microsoft.com.

Repository names must be all lowercase. My 'repository:tag' was not in fact valid - perhaps also evidenced by my use of the underscore in my dummy repository name, which I'm not sure is valid either. What a trip.

Closing