azure-web-app-serviceazure-webappsgithub-package-registryazure-web-app-for-containers

How to deploy docker image from Github Package Registry to Azure Web Apps


I have Github Package Registry about Docker Image. I want to deploy it to Azure Web Apps. I try the setup like this,

  1. Server URL: https://docker.pkg.github.com
  2. Full Image Name & Tag: berviantoleo/my-telegram-bot/my-telegram-bot:latest

I'm not fill the username & password, because it is public docker image. I also already try to bring username & password, but no luck, still failed to pull.

I see from the logs, it have logs like this:

2020-11-16T02:46:04.868Z INFO  - Pulling image from Docker hub: berviantoleo/my-telegram-bot/my-telegram-bot:latest

It's very weird because I already change the Server URL, is it the Server URL only support Docker Hub? I need help about this. I already try from Dockerhub, yeah, it can be deployed. But for now, I want to try from Github Packages Registry.

Update:


Solution

  • Well, if you pull the image from the public registry then you do not need to set the credential, and by default, the public registry is the docker hub. For other registries, private registry, you need to set the environment variable DOCKER_REGISTRY_SERVER_URL to tell the Web App to pull images from it. And set the DOCKER_REGISTRY_SERVER_USERNAME and DOCKER_REGISTRY_SERVER_PASSWORD for the credential. For a quick test, the image you used should be in the private registry. So you need to set the credential for it.