是否可以将单独的Azure应用程序服务作为另一个应用程序服务的一部分?
例如,假设我有一个名为
因此,换句话说,当请求提交
提前致谢。
Is it possible to include a separate Azure App Service as part of another App Service?
For example lets say that I have a website called www.mycompany.com hosted in its own Azure App Service. I have another Azure App Service that I want to make it accessible by going to a specific URL in the first App Service.
So in other words when a request comes to www.mycompany.com/eu/ I want the content of this endpoint (/eu) to be served from the other app service. Would a load balancer work? The reason I want to do this is because the /eu endpoint has grown too big and I would like to separate that from the main site and host it on a separate app service. I hope my question is clear.
Thanks in advance.
发布评论
评论(2)
为此,您可以使用应用程序网关。
从某种意义上说,它类似于您指出的负载平衡器(确实是L7 lb),但是该产品提供了许多其他功能。
从产品文档中提取的以下图像解释了它的工作原理:
基本上,如上述文档在描述应用程序网关如何接受请求时(请注意,他们在说明中提到WAF,这是一种可选的安全威胁预防系统):
连接到一个后端或另一个后端的路由可以基于 url路径:
您可以在此相关的Microsoft Article 。
在您的用例中,您需要定义两个后端,一个用于每个应用程序服务,并根据适当的方式定义路由规则。
如前所述,您的DNS应指向应用程序网关:它将根据路由来处理到一个或其他应用程序服务的路由,
/eu/*
或/*
,由客户提供。路线的顺序很重要:一旦规则匹配,它将是处理的。
应用程序网关是一项区域服务: Azure前门在全球范围内利用类似的功能(以及更多功能)。
请考虑查看这些服务的相关费用。
For this purpose you could use Application Gateway.
In a certain sense it resembles a load balancer (it is a L7 LB indeed) as you indicated, but the product provides many additional features.
The following image, extracted from the product documentation, explains how it works:
Basically, as outlined in the aforementioned docs, when describing how an Application Gateway accepts a request (note they mention WAF in the explanation, an optional security threat prevention system):
The routing to one backend or another can be based on URL Paths:
You can find an example of this configuration in this related Microsoft article.
In your use case, you will need to define two backends, one for every App Service, and define routing rules as appropriate.
As indicated before, your DNS should point to the Application Gateway: it will handle the routing to one or other App Service based on the route,
/eu/*
or/*
, provided by the client.The order of the routes is important: once a rule is matched, it will be the one processed.
Application Gateway is a regional service: Azure Front Door leverages a similar functionality (and much more) globally.
Please, consider review the associated costs of these services.
我正在回答自己的问题,希望在同一情况下帮助其他人。这只是使用反向代理完成。本文介绍了您需要进行设置所需的一切 - https://ruslany.net/2014/05/ususion-azure-web-site-site-as-a-resverse-proxy/
I am answering my own question to hopefully help others in the same situation. This was simply done using a reverse proxy. This article explains everything you need to set it up - https://ruslany.net/2014/05/using-azure-web-site-as-a-reverse-proxy/