简体   繁体   English

如何将ASP.NET MVC 5 Web App部署到Azure中的虚拟网络

[英]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.

相关问题 如何在Azure虚拟机中部署ASP.NET Web应用程序 - How to deploy asp.net webapp in azure virtual machine ASP.Net如何将文件上传到与Web应用程序位于同一服务器上的虚拟目录 - ASP.Net How can I upload file to virtual directory on same server as web app 部署到azure Web应用程序后ajax asp.net无法正常工作 - ajax asp.net not working after deploy to azure web app 如何将 ASP.NET Web 应用程序部署到 Azure 与现有的 Z9778840A0104CB30C52ZB7 服务器数据库 (76410CB30C52ZB7) 服务器数据库 - How to deploy an ASP.NET Web App to Azure with an existing SQL Server database (Azure Data Studio) 如何使用git在Azure中部署和运行ASP.NET MVC 6 Web API项目 - How to deploy and run an asp.net mvc 6 web api project in azure using git 无法将最简单的ASP.NET Core Web App部署到Azure VM - Can't Deploy Simplest ASP.NET Core Web App to Azure VM 将ASP.Net 5 Web App部署到Azure时如何删除现有文件 - How can I delete existing files when deploying an ASP.Net 5 Web App to Azure 如何将ASP.NET MVC Web应用程序的标识/身份验证部分移到类库中? - How can I move the identity/authentication part of my ASP.NET MVC web app into a class library? 我可以在MVC站点下的虚拟目录中使用传统的ASP.NET Web应用程序吗? - Can I have traditional ASP.NET Web Applications in Virtual Directories under MVC Site? 如何将ASP.NET MVC 5 Web App部署到带有Visual Studio 2015 Enterprise的Apache(带有Mono)? - How to Deploy ASP.NET MVC 5 Web App to Apache w/ Mono w/ Visual Studio 2015 Enterprise?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM