[英]How can I deploy an ASP.NET MVC 5 Web App to a Virtual Network in Azure
I have an existing ASP.Net MVC 5 Web Application (and associated web services) that I've been asked to deploy into a specific VNet (virtual network) within Azure. 我有一个现有的ASP.Net MVC 5 Web应用程序(和关联的Web服务),已被要求部署到Azure内的特定VNet(虚拟网络)中。 I've googled this to death and struck out.
我用谷歌搜索将其杀死并删除了。
The best I've found is to edit a ServiceConfiguration.cscfg file to include a node like this: 我发现最好的方法是编辑ServiceConfiguration.cscfg文件以包含如下所示的节点:
<NetworkConfiguration>
<VirtualNetworkSite name="Test-VNet" />
<AddressAssignments>
<InstanceAddress roleName="Test-Role-1">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
The problem with this is that .cscfg files APPEAR to be unique to Azure Cloud Service Deployment projects, which don't appear to be of any help when deploying an Azure Web Site. 这里的问题是,.cscfg文件似乎是唯一的Azure的云服务部署项目,部署Azure的Web站点时不会出现有任何帮助。 If this is the only way then I'm going to have to create a bunch of Cloud Service projects, port the code into them and then re-test.
如果这是唯一的方法,那么我将不得不创建一堆Cloud Service项目,将代码移植到其中,然后重新测试。 This is likely to be pretty time-consuming and I don't think that management will appreciate the risk.
这可能很耗时,而且我认为管理层不会意识到这一风险。
Am I going to have to re-create the Web Application projects into Azure Cloud Services to deploy them into VNets, or is there another way...? 我是否必须在Azure云服务中重新创建Web应用程序项目才能将其部署到VNet中,还是有另一种方法...?
In the end I gave in, created Cloud Service projects (with associated deployment packages) to replace the web services and ported the code across. 最后,我放弃了,创建了Cloud Service项目(带有关联的部署程序包)来替换Web服务,并在其中移植了代码。 It didn't take too long and required very few code tweaks.
花费的时间并不长,几乎不需要任何代码调整。 The public facing web site I left as a standard Web Application.
我作为标准Web应用程序离开的面向公众的网站。
Having done this I was able to deploy my private Web Services (now cloud services) into Azure Virtual Networks, where they were hidden from the outside world, and configure the public web site to allow it to access the components within the VNet. 完成此操作后,我便能够将私有Web服务(现为云服务)部署到Azure虚拟网络中(它们对外界隐藏了),并配置公共网站以允许其访问VNet中的组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.