user584018
user584018

Reputation: 11304

one app is hosted as azure app service and trying to call another app running with localhost - giving 500 error

Here I am getting 500 error if I host app2 as azure app service, if I run it locally over localhost, then NO issues.

Is this something block on localhost, how we can do this?

Upvotes: 0

Views: 1119

Answers (1)

Cybrosys
Cybrosys

Reputation: 664

"localhost" refers to the current machine and will in most cases translate to ip4 127.0.0.1. So if your App Sevice "app2" is calling "localhost" it is basically calling itself, not the machine you're hosting "app1" on.

If you want to call "app1" running on your local machine from an Azure App Service then you need to expose "app1" to the internet on your machine.

You'll need to know the public ip your machine is behind, make sure your router etc can route the traffic from the public ip to your machine's internal network ip (There are probably tons of other issues that you're going to run into depending on firewalls, routers, networking infrastructure, if "app1" is running on IIS Express or not, ...).

Just host both "app1" and "app2" on Azure as App Services.

Upvotes: 3

Related Questions