1

I am encountering this error when trying to call Invoke-RestMethod from Powershell and Powershell Workflow scripts on Azure Runbook.

Unable to connect to the remote server (Unable to connect to the remote server (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XX.XXX.XXX.XX:443 ))

When I make the same call locally using the same scripts, it works just fine. When I try to connect to the URL on my browser, it also works.

I am using the Invoke-RestMethod to try to call an Oozie job or a Livy job on a Spark HD Insight cluster.

Has anyone encountered this before? Any help would be appreciated. Thanks!

1 Answers1

0

This message could be the result of many dependent services on azure:

Cause

Issue happens if the machine that is running the program is behind corporate proxy (or firewall?) that allows traffic coming only from authenticated users. By default Azure/IIS configures AppPool to run under “NetworkService”. Hence, Proxy does not allow traffic coming from this account

Resolution / Workarounds

There are few ways this issue could be worked around.

At my corporate network, we use Microsoft Firewall ISA client. Hence, i have used fwctool(from ISA client install location) that ships with ISA client to explicitly allow traffic from w3wp. Below is the command i ran from Install location of ISA client to resolve the issue. fwctool enable /g /app:w3wp (This command allows w3wp traffic to go through firewall client program and ensures settings are applied globally, for all users)

Firewall Client Tool for ISA Server 2004 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=12168

Note: If you are using different firewall client other than Microsoft ISA client, you need to figure our similar command that can enable the traffic to go via firewall client configured on your machine. If you are unable to find the command, below are few options you can use to resolve the issue.

Full details are available here: https://blogs.msdn.microsoft.com/narahari/2011/12/21/azure-a-connection-attempt-failed-because-the-connected-party-did-not-properly-respond-after-a-period-of-time-or-established-connection-failed-because-connected-host-has-failed-to-respond-x-x-x-xx/