Compartilhar via


Windows Azure Websites, Web Roles, and VMs: When to use which?

The June 7th update to Windows Azure introduced two new services (Windows Azure Websites and persistent VMs) that beg the question “When should I use a Windows Azure Website vs. a Web Role vs. a VM?” That’s exactly the question I’ll try to help you answer in this post. (I say “help you answer” because there is no simple, clear-cut answer in all cases. What I’ll try to do here is give you enough information to help you make an informed decision.)

Note: The information in this post has been turned into official documentation by the Windows Azure content team. For the most up to date information, see Windows Azure Web Sites, Cloud Services, and VMs: When to use which? on WindowsAzure.com.

The following table should give you some idea of what each option is ideal for:

Windows Azure Web Sites are ideal for… Windows Azure Web Roles are ideal for... Windows Azure Virtual Machines are ideal for...

Modern Web Apps Applications that consist of client-side markup and scripting and/or server-side scripting and a database. You can scale out or up as needed.

Also the web tier of multi-tier applications.

Multi-tier Applications Applications that are composed of multiple tiers, each of which can be scaled independently (i.e. asynchronous background processing, like order processing) using both Web and Worker Roles.

Note: Web Sites can also be used for the web tier.

Server Applications Existing applications that leverage SQL Server, MySQL, MongoDB, Sharepoint Server, etc.

Continuous Development Deploy directly from your source code repository using Git or Team Foundation Service.

Apps that require advanced administration Applications that require admin access, remote desktop access, or running code with elevated privileges.

Existing line-of-business apps Choose an image from the gallery or upload your own VHD.

Popular Open Source Apps Launch a site with a few clicks using apps like WordPress, Joomla!, and Drupal.

Apps that require advanced networking Applications that require network isolation with Windows Azure Connect or Windows Azure Virtual Network.

Windows or Linux Support for Windows Server and community/commercial versions of Linux. Connect VMs with Cloud Services to take advantage of PaaS services.

Actually, I think the use cases for VMs are wide open. You can use them for just about anything you could imagine using a VM for. The tougher distinction (and decision) is between Web Sites and Web Roles. The following table should give you some idea of what Windows Azure features are available in Web Sites and Web Roles:

Feature

Web Sites

Web Roles

Access to services like Caching, Service Bus, Storage, SQL Azure Database

Yes

Yes

Support for ASP.NET, classic ASP, Node.js, PHP

Yes

Yes

Shared content and configuration

Yes

No

Deploy code with GIT, FTP

Yes

No

Near-instant deployment

Yes

No

Integrated MySQL-as-a-service support

Yes

Yes*

Multiple deployment environments (production and staging)

No

Yes

Network isolation

No

Yes

Remote desktop access to servers

No

Yes

Ability to run programs with elevated permissions

No

Yes

Ability to define/execute start-up tasks

No

Yes

Ability to use unsupported frameworks or libraries

No

Yes

Support for Windows Azure Connect/ Windows Azure Network

No

Yes

* Web or Worker Roles can integrate MySQL-as-a-service through ClearDB's offerings, but not as part of the Management Portal workflow.

As I said earlier, it’s impossible to provide a definitive answer to the question of which option you should use (Web Sites, Web Roles, or VMs). It really does depend on your application. With that said, I hope the information in the tables above helps you decide what is right for your application. Of course, if you have any questions and/or feedback, let us know in the comments.

Thanks!

-Brian

Comments

  • Anonymous
    June 28, 2012
    What about SSL certificates, and custom domain names? These are not availible in the Websites Preview at least.

  • Anonymous
    June 29, 2012
    @Thomas - Good question. Custom domain names are available in the Websites Preview in reserved mode (which is not the default, and not free: www.windowsazure.com/.../details). Support for SSL is currently not supported in either mode (shared or reserved), but this is a highly requested feature, so maybe we'll see support for it at some point. -Brian

  • Anonymous
    July 01, 2012
    Can we communicate to a worker role from a Windows Azure Website?

  • Anonymous
    July 02, 2012
    @shiju - Yes. You can access a worker role from any application, provided you have created an input endpoint for the worker role in the service definition (.csdef) file when deploying the role. The schema for the worer role .csdef file is here: msdn.microsoft.com/.../gg557552.aspx Hope that helps. -Brian

  • Anonymous
    October 14, 2012
    "Ability to use unsupported frameworks or libraries" What does it mean?

  • Anonymous
    October 15, 2012
    @Rami - Think of Web Sites as web hosting, where you don't have full access to or control over a VM. You can run code that is supported by the web host, but that's it. With Web Roles, you have full access to and control over the VM, so you can install anything you want and configure it as you like. An example here might be Ruby: it's not supported in Web Sites, but you can easily install RoR on a Web Role. Does that answer your question? -Brian

  • Anonymous
    October 21, 2012
    THXS A LOT for your clarifications. Straight to the point  ;)

  • Anonymous
    March 02, 2013
    Does PHP website really prevent people from using their own PHP library/framework? I had thought it was possible, just harder...

  • Anonymous
    March 03, 2013
    @Albert - No, Web Sites does not prevent you from using PHP frameworks. I think this post needs to be updated. Sorry for the confusion.

  • Anonymous
    April 23, 2013
    So, if I build and design websites for clients, can I act as an agent/vendor to a client? So, I'm not really reselling Windows Azure but rather I have a service relationship in place with my clients. Are there Terms of Use published for this scenario?

  • Anonymous
    April 26, 2013
    Hi Tony, there's no specific terms around doing this and no legal gotchas that I can find. I'm told by people in the know that this is expected/accepted/normal.

  • Anonymous
    July 22, 2013
    For Web Sites you say "YES" to "Access to services like Caching". Is access to caching possible with Web Sites?

  • Anonymous
    July 22, 2013
    Hi Peter, the caching Brian mentions above for web sites is the old-style Windows Azure Caching, now known as Shared Caching. This was caching as a service where you had an endpoint that the application used to communicate with the cache service, quotas, pricing for data stored, etc. Not to be confused with the new caching, which is a Windows Azure Cloud Service only thing that makes use of memory in your role instances. You can read more about shared caching at msdn.microsoft.com/.../hh914133.aspx.

  • Anonymous
    August 15, 2013
    We have some sites that we would like to move to Azure, but we are not really sure what all to choose with each. Is it possible to communicate outside of this post to explain our architecture and get your advise what to move forward with?

  • Anonymous
    August 21, 2013
    Hi John, please contact jroth at the Microsoft.com domain. He's been working on an article related to this blog post and can work with you on this.

  • Anonymous
    August 29, 2013
    The comment has been removed

  • Anonymous
    November 27, 2014
    I have web application with vb.net with crystal report and  sql server 2012 as back-end. And we want to migrate it on azure we tried out VM and now trying azure website but on VM it's working fine but on website we have problem in CR so which way we should use we have continuous development on our app as customer req. and we currently use TFS for source control.

  • Anonymous
    February 05, 2015
    I just signed up for a shared account and registered a domain http://quotelight.com I wish it had more disk space 1gb  - upgrade has 10gb and is standard (a lot more costly and I am not ready for that).  I also wish the ssl was free.  I point to the base name quotefinder.azurewebsites.net to get shared ssl. That said, I love Azure.  The console is great.  The speed and reliability is also great and I have recommended it to others.

  • Anonymous
    April 27, 2015
    How to configure performance counters for websites? Can you please help us

  • Anonymous
    April 27, 2015
    How to configure performance counters on Cloud websites (web apps ) on PAAS. (ASP.Net web application under Azure). I have better knowledge how to monitor in IAAS.

  • Anonymous
    April 28, 2015
    For monitoring web apps, I'd recommend looking at azure.microsoft.com/.../web-sites-monitor. That should document everything that is available for monitoring these.