Windows Azure for Developers Task 9: Hosting WCF Service Role in Windows Azure Hosted Service



In my previous article we saw How to work with WCF Service Web Role.

I am going to extend the previous article to publishing in a hosted service.

Hosting a WCF Service Role in a hosted service is exactly the same as hosting in an ASP.Net Web Role.

  1. Login to Azure Development portal.
  2. Create a new hosted service. If you want you can upgrade any existing hosted service to host WCF Service role also.

See: Creating Hosted Service in Windows Azure

3. To upgrade the hosted service, browse locally to:

WCF1.gif

4. Right click on an Azure project and select Publish.

5. Now while upgrading a hosted service, select the browse locally option and navigate to the folder containing the files.

6. Once publishing is done, you can navigate to the URL. On navigation you may get the error in the browser shown below:

WCF2.gif

Do not be panic; instead just append Service1.svc to the URL and you will get the WCF Service Web Role up and running.

WCF3.gif

7. We can consume the service in the exact same way thast we consume a normal WCF Service.

Up Next
    Ebook Download
    View all
    Learn
    View all