Automatically generated Github Actions yaml is wrong

Tyler Suard 25 Reputation points
2025-07-31T23:39:24.3+00:00

When I create a web app and set it up for CI/CD with a container registry and Github, Azure creates a YAML for the workflow file. That YAML is wrong, and it creates an image in a repository that the web app is not looking for. I get not found/unauthorized errors every time.

Specifically, this:

tags: ragchatcr.azurecr.io/${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME}}/ch5-image:${{ github.sha }}

Should be this:

tags: ragchatcr.azurecr.io/ch5-image:${{ github.sha }}

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargavi Naragani 7,445 Reputation points Microsoft External Staff Moderator
    2025-08-04T06:19:32.1666667+00:00

    Hi Tyler Suard,

    When you configure CI/CD using the Azure Portal with a custom container from Azure Container Registry (ACR), it automatically generates a GitHub Actions workflow file. However, the generated YAML often includes an incorrect tag format, this causes image pull failures (404 Not Found or Unauthorized) because the image gets pushed to a repository name that doesn't match what your App Service is configured to pull from.

    ragchatcr.azurecr.io/USERNAME/ch5-image is not the correct target – the USERNAME part shouldn't be there.

    Go to your GitHub repository => .github/workflows/your-workflow.yaml, find the docker build or docker/build-push-action step. Update the tags field to remove the ${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME }} segment.

    tags: ragchatcr.azurecr.io/ch5-image:${{ github.sha }}
    

    Commit the change and re-run your GitHub Actions workflow.

    Once that’s done, your container should be pushed to the expected ACR path, and your Web App will be able to pull and run it successfully.

    Configure CI/CD with GitHub Actions for App Service using container registry
    GitHub Action for Docker build and push (docker/build-push-action)
    Azure Web App for Containers - Configure container settings

    Hope this helps, if you have any further concerns or queries, please feel free to reach out to us.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.