简体   繁体   English

如何将Azure Web App服务拆分为多个“子Web应用程序服务”?

[英]How do I split an Azure Web App Service into multiple 'sub web app services'?

I have a large monolithic Azure Web App Service (written in C# ASP.NET MVC5), comprised of a few discrete subapps that have little to do with one another other than sharing a domain name. 我有一个大型的单片式Azure Web App Service(用C#ASP.NET MVC5编写),由几个离散的子应用程序组成,这些子应用程序与共享域名几乎没有关系。

I'd like to split the monolithic webapp into several 'subservice' web apps: separate projects, with new projects potentially being in a different langauge (eg. nodejs). 我想将整体式Web应用程序拆分为几个“子服务” Web应用程序:单独的项目,而新项目可能会使用不同的语言(例如,nodejs)。

It seems like I'd need a master Azure webapp that serves as the router? 似乎需要一个主Azure Web应用程序作为路由器? Or is there a better approach? 还是有更好的方法?

So eg if a request comes to http://www.example.com/subapp1 , it should be served by SubApp1, but a request to http://www.example.com/subapp2 should be served by SubApp2. 因此,例如,如果请求到达http://www.example.com/subapp1 ,则该请求应由SubApp1提供,而对http://www.example.com/subapp2的请求应由SubApp2提供。

Is there a recommended way to achieve this with Azure Web App services? 是否有推荐的方法可通过Azure Web App服务实现这一目标?

You can use virtual directories to do the division. 您可以使用虚拟目录进行划分。 This blog post has a good overview of how to set-up and deploy virtual directories for web apps: http://blogs.msdn.com/b/tomholl/archive/2014/09/22/deploying-multiple-virtual-directories-to-a-single-azure-website.aspx . 这篇博客文章很好地概述了如何为网络应用设置和部署虚拟目录: http : //blogs.msdn.com/b/tomholl/archive/2014/09/22/deploying-multiple-virtual-directories到一个单一的azurewebsite.aspx

Essentially, you would first create the main site and publish to it. 本质上,您将首先创建主站点并将其发布。 Then using the portal, create the virtual directories. 然后使用门户创建虚拟目录。 Then, for individual projects you can publish to each of those virtual directories. 然后,对于单个项目,您可以将其发布到每个虚拟目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM