locked
Is it possible to use Web Role with private could service? RRS feed

  • Question

  • User1492915735 posted

    Hi,

    Is it possible to use Web Role with private could service? I don't want to expose it as public site.

     

    Q: 2

    If I don't use web role, Is it possible to expose JSON data via Worker role.

     

    Best,

    Regards,

    Weera

    Thursday, November 28, 2013 12:06 AM

All replies

  • User-376018714 posted

    hi

    if you are on latest ASP.NET version - you can always create a Web API Self Hosting inside a worker role. With Web API the data excahnge will be either XML or JSON depending on the consuming client content negotiation...you can search in MSDN for Web API self hosting. here is an article on the same - http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api

    Another way would be to create a WCF Data service. You can self host a WCF Data Service also. take a look at this article - http://blogs.msdn.com/b/writingdata_services/archive/2011/01/24/self-hosting-a-wcf-data-service.aspx

    Another way would be to self host a WCF Service. And add the REST support to your WCF end points. here is an article which talks about WCF & REST - http://msdn.microsoft.com/en-us/magazine/dd315413.aspx

    Friday, December 6, 2013 6:32 AM
  • User1470285101 posted

    Is it possible to use Web Role with private could service? I don't want to expose it as public site.

    yes,it is possible,

    By default all web roles in the solution are public. You can change this by going into the service definition and remove HTTP endpoints, if you wish; you can also define internal HTTP endpoints that will only be available to cloud services, nothing will be exposed to the load balancer. The advantage to having all web roles in the same project is that it's easy to dynamically inspect the RoleEnvironment and each web role -- in other words, all roles in a solution are "aware" of other roles and their available ports. It's also easy to deploy one package.

    Answer from : http://stackoverflow.com/a/15620949

    And for returning JSON create WebRole using Asp.net WebApi.

    Hope this helps!!!

    Tuesday, December 10, 2013 1:57 AM