GitHub Actions: Continuous Delivery with Azure username with uppercase character

I’ve been working on this lab and I got stuck at Step 7.
I’ve modified the yml files and the jobs are triggered like a charm on label changes.
However when I wanted to test the deployed application on the link inserted into the action log I continuously ran into that my application simply hasn’t started on Azure.
Finally I found this log info on the Container settings site:

2020_12_14_lw0sdlwk00008D_docker.log:
2020-12-14T20:42:57.540Z INFO  - Pulling image: docker.pkg.github.com/ccPhaidrosz/github-actions-continuous-delivery-azure/phaidrosz-tictactoe:a417ee5096bbdb64e6658d24f12e9725e48b2614
2020-12-14T20:42:57.579Z ERROR - DockerApiException: Docker API responded with status code=BadRequest, response={"message":"invalid reference format: repository name must be lowercase"}

So I changed my username to avoid this issue. Now I’m srtuggling with a new problem, which is basically: progress :slight_smile:
Now I got the following error messages:

2020-12-14T21:48:52.877Z ERROR - Pulling docker image docker.pkg.github.com/molnar-atesz/github-actions-continuous-delivery-azure/molnar-atesz-tictactoe:cbaaa0bf4dee48e013eae34a1f5a61e7dd22c747 failed:
2020-12-14T21:48:52.877Z INFO  - Pulling image from Docker hub: docker.pkg.github.com/molnar-atesz/github-actions-continuous-delivery-azure/molnar-atesz-tictactoe:cbaaa0bf4dee48e013eae34a1f5a61e7dd22c747
2020-12-14T21:48:53.130Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://docker.pkg.github.com/v2/molnar-atesz/github-actions-continuous-delivery-azure/molnar-atesz-tictactoe/manifests/cbaaa0bf4dee48e013eae34a1f5a61e7dd22c747: no basic auth credentials"}

2020-12-14T21:48:53.139Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2020-12-14T21:48:53.143Z INFO  - Stopping site molnar-atesz-tictactoe because it failed during startup.
2020-12-14T21:58:24.708Z INFO  - Pulling image: docker.pkg.github.com/molnar-atesz/github-actions-continuous-delivery-azure/molnar-atesz-tictactoe:cbaaa0bf4dee48e013eae34a1f5a61e7dd22c747
2020-12-14T21:58:25.075Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured."}

What I’ve tried so far:

  • I destroyed my Resource group and re-created it.
  • Redeployed my app multiple times -> adding/removing stage label -> because it is quite a good feeling to see that it’s automatically triggers my workflow
  • I restarted the App Service as well

Any other idea?

I had the exact same problem. Also tried changing to use an explicit Personal Access Token with the correct permissions… no dice.

I’m curious if you found a resolution to this issue?

Hi all :wave:

I’d be more than happy to try and help you get through this Learning Lab.

@AndrewSouthpaw @molnar-atesz can you both please send over links to your repositories that you are working in and also make sure they are set to public rather than private so I can see what’s going on in them.

Please note that this will not expose your Personal Access Token to me in anyway, but it’s helpful for me to look at the history of the repo :grinning_face_with_smiling_eyes:

Thanks in advance.

Hi @AndrewSouthpaw and @mattdavis0351 I am wondering you any of you discovered a resolution for this issue? I am experiencing the same issue.

Thanks in advance.

Just in case anyone else has this issue.

TL;DR
In your workflow to spin up azure replace:

–docker-registry-server-password ${{secrets.GITHUB_TOKEN}}

with a personal access token that can access your packages registry

–docker-registry-server-password ${{secrets.REGISTRY_PASSWORD}}

Further details
The problem appears to be the use of GITHUB_TOKEN in when you configure the webapp to use GitHub packages in the Configure Azure Environment workflow. The command is:

“az webapp config container set”

According to the documentation, a GITHUB_TOKEN is generated for each workflow run and expires at the end of the workflow. Passing this value to Azure to log into the github docker package registry won’t work and results in an authentication error on Azure. https://docs.github.com/en/actions/reference/authentication-in-a-workflow

Instead create a personal access token and use that instead of GITHUB_TOKEN. See: https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

@mattdavis0351 Maybe you could confirm that the above is correct and if so update the learning lab?

Thank you…

1 Like

Thanks this works like a charm!
I’ve been stuck with this issue

@irvv17 Delighted I could help. Thanks for confirming my solution works for someone else.

Take care