RajeshSharepointGeek
RajeshSharepointGeek

Reputation: 137

How can I call WEB api service fabric which deployed on azure?

I have created locally stateless WebAPI and Statefull data service with the Visual Studio 2015. It is working perfectly in the local system and website access WebAPI service by implementing http://localhost:344/api/abc/getEmployee. Then I deployed service fabric application on Azure and received client URL

http://xyz.southeastasia.cloudapp.azure.com:1900/Explorer/index.html#/abc.apptype/app/abc.app/service/abc.app%252webservices

My problem is that how can I call my WebAPI controller and action from this Azure client URL?

http://xyz.southeastasia.cloudapp.azure.com:1900/api/abc/getEmployee is not working.

Note: This url is not secure and will use by mobile and website.

Upvotes: 2

Views: 2446

Answers (2)

BrainSlugs83
BrainSlugs83

Reputation: 6412

You need to configure an inbound TCP rule for the port you want to use. Typically you will map an inbound port (such as port 80) to the port that your application is listening on (e.g. 344).

In the Azure management portal, find the resource group of your deployed Service Fabric service; in it, there should be a "Load Balancer" resource. -- Click on that.

In there, you should find a pane called "Load Balancing Rules" (it's easy to look past it with the light gray icon, it's right above "Inbound NAT Rules").

Using the button at the top of the configuration blade, "Add" a rule for the port that you need opened; You should give it a meaningful name (such as HTTP or WebAPI, etc.) -- for "Port" this is the publicly facing port that you want mapped (e.g. port 80 for HTTP), and for Backend port, you can put the port that you're actually listening on (e.g. 344).

Finally, don't expect it to work right away. -- You will see a little "Updating" bar, you have to wait for that to finish.

Upvotes: 0

LoekD
LoekD

Reputation: 11470

You're using the wrong port to access your application. Port 19000 is a Management endpoint.

Read this to setup your API. Run your app at port 80 (if possible),

Make sure that the Azure Load Balancer has a load balancing rule for port 80 external to port 80 on the cluster nodes. More info here.

Upvotes: 2

Related Questions