serj serj - 1 month ago 7
C# Question

Can't access a basic Fabric Azure WebAPI OWIN stateless service

After following the tutorial, I've succeeded running it on

localhost:8534/simpleprime/api/values/
* having the same result as the tut.

Later publishing the solution to a remote cloud cluster, I couldn't access it using
www.clusterurl:8534/api/values
, timing out each time. Even though I got reassuring event diagnostics from Visual Studio during the deploy.

I've also tried each of the nodes seperetly, going to
http://node_ip:8543/simpleprime/api/values
, without any luck

bunch of reassuring diagnostics


  • simpleprime is the appRoot


Answer

If you want to access your service with OWIN listener on Azure, you should define ports that will be used by your application for the LoadBalancer during cluster creation.

If you for some reason forgot you can do it later by:

SERVICE PART

  1. Go to PackageRoot/ServiceManifest.xml of your service with OWIN Listener
  2. Define your endpoint directly (so SF will use your definied port number) (in my example 8081) enter image description here

  3. Re-publish application to Azure.

AZURE PART

  1. Go to Azure Portal
  2. Find the Load Balancer that is assigned to your SF (LB-nameofyourSF-namofNodeSet)
  3. In LoadBalancer settings go to Probes and add new probe like on the image below with your Port defined in ServiceManifest.xml (on my example 8081) and Protocol TCP enter image description here
    1. Add new Load balancing rule with your port and probe defined earlier and the correct port mapping (in my example 8081):

enter image description here

  1. Save and now you should be able to access your service on Azure via browser.