Recommended way to host a WebApi in Azure

loop picture loop · Jul 1, 2014 · Viewed 25.4k times · Source

I wanted to host my WebApi project on azure. But I am not getting sure which way should i use to run it on azure. Like there are Websites, Cloud Services that contain Web role and Worker role. Then which one should i choose. If cloud service is the option then which one out of Web role and worker role is good?

Any help is appreciated.

Answer

mpd106 picture mpd106 · Jul 1, 2014

For hosting a simple web API (that you can scale according to usage, etc.) you'll want to use Websites. Assuming you're not looking for more complex / heavy-weight features (network configuration, more complex architectures e.g. offloading background processing different instances via queueing mechanisms, RDP into the host machine, etc.), then Websites are becoming the de-facto way to host websites on Azure.

The following page from the Azure documentation will give you a full feature comparison between the two: http://azure.microsoft.com/en-us/documentation/articles/choose-web-site-cloud-service-vm/, but in short, if you simply have a web API project in VS that you want to host in Azure without worrying about the underlying infrastructure, then use Websites.