0

I have a Azure function written in Java which makes a REST call to one of our on-premise servers using its IP address and port.

i.e: GET http://<ip>:8090/example/endpoint.

The error it fails with is

HTTP/1.1 java.net.SocketException: Permission denied: connect

I have setup a VNET integration to make sure the IP is reachable from my function app.

I also got a NODE function in the same app, and that works just fine. So its something to do with the function being written in Java. Anybody hit this before and know a way to get around it?

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
Nishant
  • 161
  • 1
  • 2
  • 10

1 Answers1

0

1.You could try to set java.net.preferIPv4Stack = true by the code as below:

System.setProperty("java.net.preferIPv4Stack", "true")

2.You could try to access FQDN (fully qualified domain name) of your on-premise server. Please refer to the thread : Azure web app service to call onpremise WEB API using HttpClient using hybrid connection manager

Any concern , please let me know.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32