title: Deploy Web Role from Worker Role in Azure
body: <p>I'm researching some Windows Azure stuff, in order to make a decision whether to move to Azure or not.</p>
  
  <p><strong>Basic information</strong><br>
  To answer the question, you'll need some basic understanding of my app so here goes.</p>
  
  <p>The app is an ASP.NET MVC 3 application that connects to a SQL Server database. </p>
  
  <p>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.</p>
  
  <p>I have one SQL Server, where each instance has its own database.</p>
  
  <p>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.</p>
  
  <p><strong>Now to the question</strong><br>
  Whenever someone signs up for a free trial, I add a record to an Admin database I have. </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Does this require a lot of work to set up? Is it even possible?</p>