loop
loop

Reputation: 9242

Recommended way to host a WebApi in Azure

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.

Upvotes: 19

Views: 27889

Answers (3)

Tola Ch.
Tola Ch.

Reputation: 198

If you only want to host a Headless (No Web Interface) Web API, I recommend you using Azure Web Service - Web Role.

For Worker Role, it is like a console application that you want to use it to process background task. Normally, we use it to process from Message Queue (Azure Service Bus - Queue).

Azure create a Optimize VM to run those two type of Roles with no unnecessary junks. So you will get the most of it.

However, I still suggest you to read more detail document from azure website to see what environment which is best fit for your long term plan.

Upvotes: 3

mpd106
mpd106

Reputation: 768

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.

Upvotes: 14

cracker
cracker

Reputation: 4906

You need to login in Azure (https://manage.windowsazure.com) -> Web Sites -> Create New

After that you will find the Name of the Web Site Under the Web Sites.

Click Web Sites -> Select New Created Web Site -> Go TO -> Deployement

In Deployement -> Find -> Integrate source control

Select Appropriate Option i.e GitHub or Dropbox etc..

Using Dropbox => Now Publish your WebApi Project and Paste that Data into Dropbox Folder With the same name of your New Created Web Site in Azure

After Upload Go To -> Azure -> Select Web Site -> Deployement -> Sync.

It will take all the data from Dropbox and You can run your WebApi Project From Azure

More Details Link, Link2, Link3

Upvotes: 2

Related Questions