Friday, December 27, 2013

Hosting Web Api and WCF service in Windows Azure


It wouldn’t be wrong saying that Windows Azure is the platform of awesomeness. You can do a lot of cool stuffs in Windows Azure. And most interestingly, you pay as you use. For developers it is free of course. You can create mobile services and use them in any platform, being Android, iOS, Windows phone 8 or whatever you might think of, Azure supports it.

We have seen already how we can create Azure Mobile services and use them in various platforms. This post will now shed the light on how exactly we can host the already created Web Api or WCF service in azure.

Here I am not going in detail of about how one can create a Web Api or a WCF service. However, if you need some getting started guidelines you can read the following links for WEB API and WCF Services.
I am therefore simply assuming that you have a WCF service or a Web API project, hosted ready.

Navigate to Windows Azure portal. Choose New –> Compute –> Web Site –> Quick Create.

image

Give your website a URL and server location when asked for.

image

Click on the “Create Web Site”. Once the website is created, choose the website from the portal.

image

Then click on “Reset your deployment credentials” link. It will ask for entering a username and password. When you are done, click on the “Right Mark” to save the settings.

image

Now choose the “Download the publish profile” option from the dashboard. It will download a publish profile file. Save it safe somewhere onto your hard drive.

image

The next step is to open the Web Api / WCF service project in Visual Studio 2012-2013. Once the project is up, right click on the solution in the solution explorer and choose publish.

image

A publish dialog box will pop up. Choose import from the dialog and browse for the publish profile file downloaded from Azure.

image

Then click on publish. It would take half a minute or so to publish the project. Once the publish is complete, you can browse your Web Api from the browser via the URL that you have created in step 2. For my case, I can navigate to http://neeleshwebsitedemo.azure.net to access my hosted Web Api.

This is awesome isn’t it? I hope you’ve enjoyed the post. Stay tuned for more.

Happy Reading!!

Share this post

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© 2013 Neelesh Vishwakarma
Posts RSS Comments RSS
Back to top