如何在天蓝色的两个不同端口上公开容器的Web应用程序? [英] How to expose web app for container on two different ports in azure?

查看:77
本文介绍了如何在天蓝色的两个不同端口上公开容器的Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Web应用程序在两个端口上运行azure Web应用程序默认情况下公开用于第1部分的端口80,但对于第2部分,我们需要另一个端口如何公开它?

Our web app runs on two ports azure web app exposes port 80 by default which we have used for part 1 but for part two we need another port how can we expose it?

我们的Web应用程序可以在本地完美运行。

Our web app runs perfectly on local.

我们的Web应用程序可以在两个端口上的容器实例上完美运行(Azure中的一个选项可以在创建多个端口时使用容器实例)。

Our web app runs perfectly on container instance on two ports (there is an option in Azure for multiple ports while creating the container instance).

更新

我联系了Azure支持团队为此,他们回答:

I contacted the Azure support team for this and they replied:


容器Web应用程序当前仅允许您将一个端口暴露给外界。这意味着您的容器只能在单个端口上侦听HTTP请求。某些应用程序需要多个端口,例如,您可能有一个端口用于向应用程序发出请求,而另一个端口则用于仪表板或管理门户。在容器的Web应用程序中无法进行配置。

" Web App for Containers currently allows you to expose only one port to the outside world. That means that your container can only listen for HTTP requests on a single port. Some apps need multiple ports. For example, you might have one port that is used for requests into the app and a separate port that is used for a dashboard or admin portal. As of today, that configuration isn't possible in Web App for Containers.

我们将尝试检测w hich端口可以绑定到您的容器,但是您也可以使用WEBSITES_PORT应用程序设置,并为其配置要绑定到容器的端口的值。

We will attempt to detect which port to bind to your container, but you can also use the WEBSITES_PORT app setting and configure it with a value for the port you want to bind to your container.

因此,很抱歉,您不能在同一Web应用程序中使用2个端口。

So, I'm sorry but you cannot use 2 ports for the same web app."

推荐答案

对于您的问题,您应该知道Azure Web App和Azure Container实例之间有区别。

For your issue, you should know there are differences between Azure Web App and Azure Container Instance.

在Azure Web App中,您只能使用两个端口:80和443。默认情况下它们是公开的。您只需要在容器中听一个或两个即可。但是在Azure容器实例中,您可以根据需要公开容器中使用的所有端口。

In Azure Web App, you just can use only two ports: 80 and 443. And they are exposed in default. You just need to listen to one of them or both in the container. But in Azure Container Instance, you can expose all the ports that you use in the container as you wish.

因此,对于容器的Web应用程序,如果两个端口都没有80和443,那么您将无法暴露它们。

So for Web app for Container, if the two ports are not 80 and 443, then you cannot expose them.

这篇关于如何在天蓝色的两个不同端口上公开容器的Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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