0

Created Azure app services web app without using any Docker registry integration.

I want achieve below.

1] create, tag image on my Linux machine 2] deploy local Docker image to App services web app using below

az webapp config container set --name springboot-docker-helloworld-app --resource-group SpringBoot --docker-custom-image-name org/dockerspringtboot-metinv:latest

But it is not working.

Is it possible to deploy local Docker images to Azure app services web app ?

1 Answers1

1

You'll need to push your container image to an Azure container registry from which your Azure web app can pull the image.

You can do this using Azure CLI with the following steps:

$ az acr create --resource-group your_rg \
                --name yourAcrName --sku Basic 

# login to the container registry locally
$ az acr login --name yourAcrName 

# update the container registry to use admin-enabled 
# https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#admin-account
$ az acr update -n yourAcrName --admin-enabled true

# tag your local image to the container registry
$ docker tag dockerspringtboot-metinv:latest yourAcrName/dockerspringtboot-metinv:latest

# push image to your container registry
$ docker push yourAcrName/dockerspringtboot-metinv:latest

Then you can create an app service plan and deploy the web app specifying to use your container registry.

$ az appservice plan create -g your-rg \
                            -n your-app-plan \
                            --sku B1 --is-linux 

# deploy your container as an app in the created App Service plan
$ az webapp create -g your-rg \
                   -p your-app-plan \
                   -n dockerspringtboot \
                   -i yourAcrName/dockerspringtboot-metinv:latest

Sparrow0hawk
  • 517
  • 4
  • 13
  • Thank you. Is it possible to deploy local Docker images to Azure app services web app ? i dont want to pull from/use any container registry like ACR, Docker hub etc.. – Srinivas Charan Mamidi Oct 19 '21 at 10:43
  • Because your webapp will stop and start it needs to have a registry from which it can pull the container image each time. That means you can't just push your image locally to the app service and leave it running, you have to create a registry either on Azure or via DockerHub. Is there a particular reason you don't want to use a container registry? Azure allows you to create a private registry that keeps your images private. – Sparrow0hawk Oct 19 '21 at 10:52
  • Thank you. I want to avoid dependency on a particular registry. From my devops pipeline, i want to pull from any registry required registry ronto my build agent, and push that local copy directly to App service ... – Srinivas Charan Mamidi Oct 19 '21 at 16:29
  • Then I don't believe it is possible to deploy an Azure app service app like that. You may be able to run azure container instances without a registry (see this [example using docker CLI](https://docs.docker.com/cloud/aci-integration/)). – Sparrow0hawk Oct 21 '21 at 14:33