简体   繁体   English

为什么在Azure SDK中使用Azure云服务项目而不是ASP.NET项目?

[英]Why use an Azure Cloud Service Project instead of an ASP.NET project with the Azure SDK?

I'm playing with Azure asp.net development. 我正在玩Azure asp.net开发。 I use Visual Studio 2010, with Azure SDK and I'm a newbie to Azure cloud. 我使用Visual Studio 2010,Azure SDK,我是Azure云的新手。

I created several apps and deployed them to my testing Azure Web Site. 我创建了几个应用程序并将它们部署到我的测试Azure网站。 Everything works fine - ASP.NET Web Page, ASP.NET MVC3, even simple GridView binding to an Azure SQL database, which I created earlier and that I manage with Microsoft SQL Management Studio, using ADO.NET. 一切正常 - ASP.NET Web Page,ASP.NET MVC3,甚至是我之前创建的Azure SQL数据库的简单GridView绑定,我使用ADO.NET管理Microsoft SQL Management Studio。 It's really simple. 这很简单。

Now, I learned from some tutorials, that I need to use a Windows Azure Cloud Service Project to make sure that my application will work. 现在,我从一些教程中了解到,我需要使用Windows Azure云服务项目来确保我的应用程序能够正常运行。 But it works without this project, too. 但它也没有这个项目。 So what exactly do I need such a project in my solution for? 那么我在解决方案中究竟需要这样一个项目呢?

There are actually three different ways you could have gotten your ASP.NET app over to the cloud, and the confusion comes because you are seeing elements of two of those options. 实际上有三种不同的方法可以将ASP.NET应用程序转移到云端,因为您看到了其中两个选项的元素,所以会产生混淆。

A Windows Azure Web Site is just a single ASP.NET application running in Microsoft's data centers (versus on premises) so all of the configuration it needs is already part of the project itself (primarily the web.config), some being exposed via the Azure portal. Windows Azure Web站点只是在Microsoft的数据中心运行的一个ASP.NET应用程序(与内部部署相比),因此它所需的所有配置已经是项目本身的一部分(主要是web.config),有些通过Azure门户。 In many ways, this is similar to web hosting providers. 在许多方面,这类似于网络托管服务提供商。

A Windows Azure Cloud Service is a collection of multiple services, which could be web sites/services (Web Roles) or backend code (Worker Roles). Windows Azure云服务是多个服务的集合,可以是网站/服务(Web角色)或后端代码(工作角色)。 The code for your Azure Web Site could also have been deployed exactly as is as a Web Role, but in that case it would be part of a larger application that potentially contains additional Web and Worker Roles. Azure Web站点的代码也可以完全像Web角色一样进行部署,但在这种情况下,它将成为可能包含其他Web和工作者角色的更大应用程序的一部分。 It's the Cloud Service project itself that provides the additional configuration of those web and worker roles (even if you have just a single role in the cloud service). 云服务项目本身提供了这些Web和辅助角色的附加配置(即使您在云服务中只有一个角色)。 The Cloud Service offering is considered Platform as a Service. Cloud Service产品被视为平台即服务。

The other option, for completeness, is to create a Virtual Machine image yourself, install your ASP.NET site, and then have Windows Azure host the Virtual Machine. 另一个选项是完整性,即自己创建虚拟机映像,安装ASP.NET站点,然后让Windows Azure托管虚拟机。 It's at the opposite end of the 'make it simple to deploy' spectrum, but you get a lot of control over what exactly is on the VM that you deploy. 它处于“简化部署”频谱的另一端,但您可以很好地控制部署的VM上的确切内容。 This is the Infrastructure as a Service offering from Azure. 这是Azure提供的基础架构即服务。

I'm going to assume you're developing for Windows Azure Cloud Services (the foundation PaaS solution of Windows Azure). 我将假设您正在开发Windows Azure云服务(Windows Azure的基础PaaS解决方案)。 The Cloud Service project defines your application to the Windows Azure Fabric. Cloud Service项目将您的应用程序定义到Windows Azure Fabric。 If you don't already have one, then odds are your are running your application outside of the local Development Emulator. 如果您还没有,那么您在本地开发仿真器之外运行应用程序的可能性很小。 If you are going to deploy your solution to Windows Azure Cloud Services, you will need to create this project for your application so Windows Azure's Fabric (the secret sauce that will manage your application) knows how to manage the application. 如果要将解决方案部署到Windows Azure云服务,则需要为应用程序创建此项目,以便Windows Azure的Fabric(管理应用程序的秘诀)知道如何管理应用程序。

而且我将假设与@BrentDaCodeMonkey相反 - 您正在为Azure网站而不是云服务进行开发 - 在这种情况下,您可能会对教程感到困惑,因为我不相信云服务项目是必要的还是可取的。

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

相关问题 在Azure移动服务项目和Asp.Net MVC项目之间共享数据库 - Share a database between an Azure Mobile Service project and an Asp.Net MVC project ASP.NET Core 2.0 Azure Webjobs SDK添加项目引用抛出异常 - ASP.NET Core 2.0 Azure Webjobs SDK adding project reference throws exception Azure DevOps Continuous Integration with asp.net web forms website project instead of web application - Azure DevOps Continuous Integration with asp.net web forms website project instead of web application 在Azure云服务上部署ASP.NET网站 - Deploy an ASP.NET WebSite on an Azure Cloud Service Windows Azure云服务asp.net配置文件更改 - Windows Azure cloud service asp.net config file changes 一种将ASP.NET 5发布到Azure云服务的方法? - A way to publish ASP.NET 5 to Azure Cloud Service? 在Azure Service Fabric解决方案中通过Docker容器发布ASP.NET MVC项目 - Publish ASP.NET MVC Project via Docker Container in Azure Service Fabric solution 使用Azure作为ASP.NET MVC4项目的数据库 - Using Azure as database for asp.net mvc4 project 如何在azure上发布asp.net项目+ SQL [首次迁移] - How to publish asp.net project + Sql [First Migration] on azure 如何使用ASP.NET MVC项目启动Azure模拟器 - How to start the Azure emulator with an ASP.NET MVC project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM