Azure应用服务Docker容器``服务不可用'' [英] Azure app service docker container 'Service Unavailable'

本文介绍了Azure应用服务Docker容器``服务不可用''的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照教程将.net核心Web应用程序构建到docker映像中,发布到Azure容器注册表中,然后设置了VSTS Release模板,以将容器部署到应用程序服务中.

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.

这一切似乎正常,我可以在容器注册表中查看我的图像,并且部署似乎成功了-但是当导航到应用程序服务站点时,我得到的只是HTTP 503-服务不可用.

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.

应用程序服务已启动,我可以通过bash查看文件系统中的部署-所以我想知道是否丢失了某些东西?

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?

该网站可在VS2017上完美运行,包括通过docker进行调试,因此实际上只是一种情况……我如何获得App Service来实际加载和执行图像?

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?

谢谢!

编辑

此外,我还可以访问docker诊断日志,其中声称映像操作系统"windows"无法在该平台上使用".

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

我的基本映像是microsoft/aspnetcore:2.0映像,它在开发环境中的linux容器上运行得非常好...但是在Linux App Service中似乎不起作用?

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?

aspnetcore:2.0基本映像是否不适合linux应用服务?

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

推荐答案

我最后解决了这个问题,希望答案能对其他人有所帮助.

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

当使用VSTS托管生成代理生成从docker base microsoft/aspnetcore:latest运行的映像时-除非您使用(Linux Preview)托管生成代理,否则将生成Windows容器,该容器不会在linux上运行应用服务.

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.

一旦我切换到使用托管的Linux构建代理,容器就会成功加载,并且我的问题已解决.

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

这篇关于Azure应用服务Docker容器``服务不可用''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆