سؤال

I'm researching some Windows Azure stuff, in order to make a decision whether to move to Azure or not.

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.

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.

I have one SQL Server, where each instance has its own database.

I also have a set of Windows Services to do some background processing. 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.

Now to the question
Whenever someone signs up for a free trial, I add a record to an Admin database I have.

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.

So, how can I deploy a new instance in Windows Azure from a Worker Role? 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.

Does this require a lot of work to set up? Is it even possible?

هل كانت مفيدة؟

المحلول

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

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.

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. Look at the webdeploy code that actually manipulates IIS.

Further: take a look at Cloud Ninja, a project a few of my teammates published along with 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. I hope that helps a bit...

نصائح أخرى

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. Inside this app they have an "onboarding process" - and that process includes setting up new SQL connections and new portals.

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top