Deploy Docker Containers to Azure Web Apps on Linux from Azure Container Registry
App Service in Azure provides application stacks on Linux which supports some versions of .NET CORE, PHP, Node.js on Linux using Docker containers to host these pre-built application stacks. It also supports custom Docker image to deploy your web app to an application stack that is not already defined in Azure. Custom Docker images can be hosted on either a public or private Docker repository.
In this article, I walk you through how to deploy a custom Docker image on Linux from a private Docker repository in this case, Azure Container Registry.
In a previous post, in this article, we say why and how to use Azure Container Registry. So, I am not going to repeat myself and assumption here is that you already have a Docker image of your project build and push to Azure Container Registry.
On Azure portal click on New and search for Web App.
You should now see a few different options, we are going to select the top one Web App On Linux (Preview) and then select create.
It takes us to the configuration blade. You should see the usual fields to complete e.g. App name, Subscription, Resource group etc.
After completing these fields, let’s select plan and the location.
And now the pricing.
Now, let’s configure the container. Expanding configure container tab will give a few options. You will be presented with a list of default 'Runtime Stacks'. These defaults allow you to quickly provision a container with the required technology stack, which you will then need to deploy your application into to.
Here we use private registry option.
Please note that you need to prefix Login Server e.g. myregistrydemo.azurecr.io with Image and Optional tag Field. You also need to prefix http:// to Server URL field, otherwise you are getting validation error.
Now let’s create our application.
You will see the notification.
After successful deployment you should see status of you application as running.
Click on Browse to see your application on browser.
That is about it for this. I've use a simple 'Hello World' Docker image that I built using ASP.NET CORE and push it to Azure Registry Container.
Number of Views:1707