Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure app service docker container 'Service Unavailable'

I have followed the tutorials for building a .net core web application into a docker image, publishing to an azure container registry, and then I have setup my VSTS Release template to deploy the container to the app service.

This all appears to work, I can view my image in the container registry, and the deployment appears to succeed - but when navigating to the app service site, all I get is an HTTP 503 - Service unavailable.

The app service is started, I can see deployments in my file system via bash - so I wondered if I am missing something?

I do not have a 'startup' command in any of my templates, I wondered if it could be this?

The site works perfectly from VS2017, including debugging via docker, so it really is just a case of... how do I get the App Service to actually load and execute the image?

Thank you!

EDIT

Further to this, I have got access to the docker diagnostics logs which claim "image operating system "windows" cannot be used on this platform".

My base image is the microsoft/aspnetcore:2.0 image, which runs perfectly fine on my linux container in my development environment... but appears to not work in the Linux App Service?

Is the aspnetcore:2.0 base image not suitable for a linux app service?

like image 811
watdo Avatar asked Aug 29 '17 13:08

watdo


People also ask

Does Azure App Service use Docker?

Azure App Service uses the Docker container technology to host both built-in images and custom images. To see a list of built-in images, run the Azure CLI command, 'az webapp list-runtimes --os linux'.

Does Azure App Service use containers?

Working with a container image in Azure App Service is straightforward. Start with a container with your code in it stored in the Azure Container Registry. There's support for both Windows and Linux containers, although in practice, most of your applications will be running on Linux.

How do I run the Docker image in Azure App Service?

In Docker Explorer, navigate to your image under Registries, right-click on the tag, and select Deploy Image To Azure App Service.... When prompted, provide the values for the App Service. New web app name: The name must be unique across Azure. Resource group: Select an existing resource group or create a new one.

Does Azure support Docker containers?

The Docker Azure Integration enables developers to use native Docker commands to run applications in Azure Container Instances (ACI) when building cloud-native applications.


1 Answers

I ended up resolving this week, hopefully the answer will help others.

When using VSTS Hosted build agents to produce images running off the docker base microsoft/aspnetcore:latest - unless you use the (Linux Preview) hosted build agent, you will get produced a windows container, which will not run on the linux app services.

Once I switched to using the hosted linux build agent, the container successfully loads, and my issue is resolved.

like image 184
watdo Avatar answered Sep 18 '22 16:09

watdo