Ever wonder when to choose Websites over Web Role or vice versa for your application, here we will discuss some differences between them and features from Websites perspective. To set context on what we are discussing, following screen shot from https://manage.windowsazure.com illustrates the scale choices for Websites and in this case a dedicated VM instance of size Small and instance count 1 is shown as chosen.
High Availability:
This is one of my favorites about Websites service, though least talked about. With Websites hosted even on 1 single dedicated instance, you can get almost same availability as if having 2 instances of Web Role. In fact it is recommended to have at least 2 instances for Web Role or Worker Role hosted services to get decent availability. On Websites though the service takes care of relocating your Website to a healthy VM very quickly and sometimes the clients doesn’t even realize the switch over (it may not be that quick always, but very close).
Developer Experience:
If I ever get unsolicited appreciation about a service, that would be about how easy it is to deploy a web application to Windows Azure Websites. Developers explain as if they got liberated, because Websites made it so damn easy to move their web application to cloud.
- No source code change needed - from running app on premise to Azure Cloud
- Familiar and same deployment options work for Websites on both on premise and Azure cloud: FTP, Web Deploy, Visual Studio Publishing, GIT, TFS etc. work exactly as it works for IIS – no special packaging and service definitions (.CSPKG or .CSDEF) needed like it is needed for Web Role
- Portal support for configuration updates like: app settings or update connection strings or enable tracing can be updated right from the portal without redeploying your app
Easy Scale Options:
The only solution available out there right now to simply go from Shared to Multi Instance Shared to Dedicated VMs is Websites Service. Makes at most business sense to start at the shared level pay very less COGS for your service and only pay more if your service gets more usage and when it does – all you have to do is move a slider: no code change or deployment needed. You can also scale down as easily as you scaled up, so long as you reduce the site usage and file contents to be within the down level quota.
You may still want to choose Web Role:
- If you have a webapp
- That requires full control over a VM
- Does lots of calls which might otherwise be considered threatening or not very secured in a shared hosting environment
- Needs to install many custom software to run
- Wants to open and operate on different ports other than standard http ports
- Has to be always ON even without client requests because of timer and scheduled based operations etc.
- Though in my opinion – if your webapp needs so many of the above, though you are calling it as a web application (meaning presentation layer component) – you are trying to do more than that and the app has combined different tiers of your solution into one app or something like that, in which case use Web Role.
Note from author:
Please consider sharing your own experiences, pain points about migrating and running apps on Windows Azure Websites in the comments section. I will consolidate and try to address them in the next blog post. – Ravi C Kolandaiswamy, Windows Azure Websites.