简体   繁体   English

从Azure中的辅助角色部署Web角色

[英]Deploy Web Role from Worker Role in Azure

I'm researching some Windows Azure stuff, in order to make a decision whether to move to Azure or not. 我正在研究Windows Azure的一些内容,以便决定是否迁移到Azure。

Basic information 基本信息
To answer the question, you'll need some basic understanding of my app so here goes. 要回答这个问题,您需要对我的应用程序有一些基本的了解,因此请继续。

The app is an ASP.NET MVC 3 application that connects to a SQL Server database. 该应用程序是一个连接到SQL Server数据库的ASP.NET MVC 3应用程序。

It is a single instance application, meaning that every customer eventually has their own instance of the app running on our server, deployed to IIS 7 as a website. 它是一个单实例应用程序,这意味着每个客户最终都会在我们的服务器上运行自己的应用程序实例,并将其作为网站部署到IIS 7。

I have one SQL Server, where each instance has its own database. 我有一个SQL Server,其中每个实例都有自己的数据库。

I also have a set of Windows Services to do some background processing. 我也有一组Windows服务来做一些后台处理。 That should be straight forward, as I'll just rewrite those to use a Worker Role in Windows Azure - most of the logic in the services is located in their own class (library) anyway, so the service it self just calls one or more methods in a class. 这应该很简单,因为我将重写它们以在Windows Azure中使用工作者角色-服务中的大多数逻辑无论如何都位于其自己的类(库)中,因此它本身的服务仅调用一个或多个类中的方法。

Now to the question 现在到问题
Whenever someone signs up for a free trial, I add a record to an Admin database I have. 每当有人注册免费试用版时,我都会将记录添加到我拥有的Admin数据库中。

I then have a Windows Service that deploys a new instance of the ASP.NET MVC 3 app to IIS, grants permission to a few folders, runs the database deployment script and updates the record to reflect that it has now been deployed, and finally sends an e-mail to the prospect that their free trial has been created - here's how you access it. 然后,我有一个Windows服务,该服务将ASP.NET MVC 3应用程序的新实例部署到IIS,向几个文件夹授予权限,运行数据库部署脚本并更新记录以反映它已经被部署,最后发送一封电子邮件,告知他们已经创建了他们的免费试用版-这是您访问它的方式。

So, how can I deploy a new instance in Windows Azure from a Worker Role? 因此,如何从辅助角色在Windows Azure中部署新实例? Preferably, I'd just add a new website to an existing Azure instance and create a new SQL Azure database for that particular site to use. 最好,我只是将一个新网站添加到现有的Azure实例中,并为该特定网站创建一个新的SQL Azure数据库。

Does this require a lot of work to set up? 这是否需要大量工作来设置? Is it even possible? 可能吗

I think most of the things you want to achieve are possible. 我认为您想要实现的大多数事情都是可能的。

It will definitely require some work to setup! 肯定需要进行一些设置工作!

For some ideas on how to achieve what you are looking for, take a look at the MS SaaS example - http://www.fabrikamshipping.com/ - especially designed for porting existing apps to SaaS on Azure. 有关如何实现所需内容的一些想法,请查看MS SaaS示例-http: //www.fabrikamshipping.com/-该示例专门用于将现有应用程序移植到Azure上的SaaS。 Inside this app they have an "onboarding process" - and that process includes setting up new SQL connections and new portals. 在此应用程序内,他们有一个“入职过程”-该过程包括设置新的SQL连接和新的门户。

There's lots of good blogging (watch the video) about this on http://blogs.msdn.com/b/vbertocci/archive/2010/10/07/new-online-demo-introducing-fabrikamshipping-saas.aspx http://blogs.msdn.com/b/vbertocci/archive/2010/10/07/new-online-demo-introducing-fabrikamshipping-saas.aspx上有很多不错的博客(请观看视频)。

Based on two quotes, I would like to suggest calling this a multi-tenant application: 基于两个引号,我建议将其称为多租户应用程序:

It is a single instance application, meaning that every customer eventually has their own instance of the app running on our server, 它是一个单实例应用程序,这意味着每个客户最终都会在我们的服务器上运行自己的应用程序实例,

And... 和...

a Windows Service that deploys a new instance of the ASP.NET MVC 3 app to IIS, grants permission to a few folders Windows服务将ASP.NET MVC 3应用程序的新实例部署到IIS,将访问权限授予几个文件夹

If I understand correctly, there is "one" IIS server (well, in Windows Azure, it's one Web Role, scalable to multiple instances), and with each new "tenant", you set up some new stuff to support that tenant. 如果我正确理解的话,这里有一个“ IIS”服务器(在Windows Azure中,它是一个Web角色,可扩展到多个实例),并且对于每个新的“租户”,您都会设置一些新的东西来支持该租户。

If that's indeed the case, you can definitely do this from a worker role - just look at Nate Totten's multi-tenant web role blog post and related code. 如果确实如此,那么您绝对可以从辅助角色执行此操作-只需查看Nate Totten的多租户Web角色博客文章和相关代码即可。 Look at the webdeploy code that actually manipulates IIS. 查看实际操纵IIS的webdeploy代码。

Further: take a look at Cloud Ninja , a project a few of my teammates published along with Fullscale180. 进一步:看看Cloud Ninja ,这是我的一些队友与Fullscale180一起发布的项目。 This is a multi-tenant app that demonstrates how to manage multiple customers in a single deployment, as well as monitoring and scaling. 这是一个多租户应用程序,演示了如何在单个部署中管理多个客户以及如何监视和扩展。

Finally: should you need to actually create brand new service hosts and storage accounts, the latest updates to the Windows Azure Management API support this. 最后:如果您需要实际创建全新的服务主机和存储帐户,则Windows Azure Management API的最新更新将支持此功能。 I hope that helps a bit... 我希望这会有所帮助...

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

相关问题 Azure Web角色在部署时开始 - Azure web role start on deploy 在Azure模拟器中测试多个Web角色实例 - Test multiple web role instances in the Azure emulator Azure Web角色-长时间运行的请求(负载均衡器超时?) - Azure Web Role - Long Running Request (Load Balancer Timeout?) 在Windows Azure Web角色中禁用/关闭URL重写模块 - Disable/Turn Off URL Rewrite Module in Windows Azure Web Role 在Azure Web角色中托管的ASP.NET MVC3应用程序中是否需要SessionStateModule? - Do I need SessionStateModule in my ASP.NET MVC3 application hosted in Azure web role? 将ASP.NET MVC 3 Web角色添加到Windows Azure项目时出现冲突的版本错误 - Conflicting versions error adding ASP.NET MVC 3 Web Role to Windows Azure project 如何设置新的成员资格和会话提供程序以在Windows Azure中运行? 使用MVC3和Web角色 - How to set up new Membership and Session providers to run in Windows Azure? Using MVC3 and Web Role 什么是Shibboleth服务提供商,可以并且应该为Windows Azure MVC3 Web角色安装它吗? - What is Shibboleth Service Provider, can & should I install it for a Windows Azure MVC3 web role? 添加TwilioController基类继承后,Microsoft Azure MVC 3 Web角色无法启动 - Microsoft Azure MVC 3 web role not starting after adding TwilioController base class inheritance 使用TFS时Azure角色状态不正常 - Azure Role state Unhealthy when using TFS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM