Select to view content in your preferred language

Webhook on GP Service - Error: Unable to create or update webhook. URL is not reachable

194
4
Jump to solution
2 weeks ago
ZachBodenner
MVP Regular Contributor

Hello, 

I've been struggling with a custom print service occasionally failing/timing out and I want to figure out just how often this is happening, so I thought to try setting up a webhook to email me when the tool runs. I'm working in local government on Power Automate, Enterprise 11.5. I've successfully set up a few PA flows based on Survey123 responses, but I'm still not super comfortable with this tool for basically any other workflow. From what I understand, I should begin this task using the 'When a HTTP request is received' trigger. I've done that, and added a second step to generate the URL.

ZachBodenner_0-1786370882400.pngZachBodenner_0-1786370882400.png

I then test out that URL in my browser and from the Server site running the GP service and get this message:

{"error":{"code":"TriggerRequestMethodNotValid","message":"The HTTP method for this request is not valid: expected 'POST' and actual 'GET'.","messageTemplate":"TriggerRequestMethodNotValid"}}

Which from previous posts I believe is a fine response?

Then I go over to my server admin and attempt to create the webhook:

ZachBodenner_1-1786370989163.pngZachBodenner_1-1786370989163.png

 

But I get the response: 'Error Unable to create or update webhook. URL is not reachable: <POST URL from PA>'

Again, fairly novice at PA, so any help is appreciated!

Happy mapping,
- Zach
0 Kudos
1 Solution

Accepted Solutions
OlaIHamed
Occasional Contributor

Hi Zach,

The response you're getting when browsing to the Power Automate URL is actually a good sign. The message:
The HTTP method for this request is not valid: expected 'POST' and actual 'GET'
simply indicates that the endpoint is reachable and that Power Automate is listening, it just expects a POST request rather than a GET request.

The "URL is not reachable" error from ArcGIS Server typically means that during webhook creation, ArcGIS Server is unable to successfully validate or connect to the endpoint.

One common cause in on-premises ArcGIS Enterprise deployments is that the ArcGIS Server machine cannot establish an outbound HTTPS connection to the Power Automate endpoint. This may be due to a firewall, proxy configuration, SSL inspection, or outbound internet restrictions.

To help narrow it down, I'd recommend testing the connection directly from the ArcGIS Server machine using PowerShell:
Invoke-RestMethod `
-Uri "YOUR_POWER_AUTOMATE_URL" `
-Method POST `
-Body '{"test": true}' `
-ContentType "application/json"

This sends a POST request from the ArcGIS Server machine, similar to what ArcGIS Server does when firing a webhook.

What to expect:

  • If the request succeeds (for example, you receive a 200 or 202 response and your Power Automate flow is triggered), then the network path is working correctly and the issue is likely elsewhere.
  • If you receive a timeout or connection error, then the ArcGIS Server machine is likely unable to reach the Power Automate endpoint. In that case, it would be worth checking with your IT team whether outbound HTTPS (port 443), proxy settings, or access to the required Microsoft endpoints is being restricted.

In our environment, we encountered a similar challenge and ultimately hosted a small webhook receiver locally (a lightweight Python API behind IIS). That approach worked well because it kept all webhook traffic within our internal network and avoided dependencies on outbound internet connectivity. While that may not be necessary in your case, it's another option if external connectivity becomes a limiting factor.

I hope this helps! I'd be interested to hear what the PowerShell test returns, as that should give a much clearer indication of where the issue lies.

Kind regards,

Ola



View solution in original post

0 Kudos
4 Replies
RichardDaniels
MVP Regular Contributor

Usually there is a middle-ware that handles the payload, I don't think you can go directly to from Survey123 or FieldMaps to ArcGIS Server?

  1. Paste the payload URL provided by your external webhook service (e.g., Power Automate, Make, Zapier) into the field.

0 Kudos
OlaIHamed
Occasional Contributor

Hi Zach,

The response you're getting when browsing to the Power Automate URL is actually a good sign. The message:
The HTTP method for this request is not valid: expected 'POST' and actual 'GET'
simply indicates that the endpoint is reachable and that Power Automate is listening, it just expects a POST request rather than a GET request.

The "URL is not reachable" error from ArcGIS Server typically means that during webhook creation, ArcGIS Server is unable to successfully validate or connect to the endpoint.

One common cause in on-premises ArcGIS Enterprise deployments is that the ArcGIS Server machine cannot establish an outbound HTTPS connection to the Power Automate endpoint. This may be due to a firewall, proxy configuration, SSL inspection, or outbound internet restrictions.

To help narrow it down, I'd recommend testing the connection directly from the ArcGIS Server machine using PowerShell:
Invoke-RestMethod `
-Uri "YOUR_POWER_AUTOMATE_URL" `
-Method POST `
-Body '{"test": true}' `
-ContentType "application/json"

This sends a POST request from the ArcGIS Server machine, similar to what ArcGIS Server does when firing a webhook.

What to expect:

  • If the request succeeds (for example, you receive a 200 or 202 response and your Power Automate flow is triggered), then the network path is working correctly and the issue is likely elsewhere.
  • If you receive a timeout or connection error, then the ArcGIS Server machine is likely unable to reach the Power Automate endpoint. In that case, it would be worth checking with your IT team whether outbound HTTPS (port 443), proxy settings, or access to the required Microsoft endpoints is being restricted.

In our environment, we encountered a similar challenge and ultimately hosted a small webhook receiver locally (a lightweight Python API behind IIS). That approach worked well because it kept all webhook traffic within our internal network and avoided dependencies on outbound internet connectivity. While that may not be necessary in your case, it's another option if external connectivity becomes a limiting factor.

I hope this helps! I'd be interested to hear what the PowerShell test returns, as that should give a much clearer indication of where the issue lies.

Kind regards,

Ola



0 Kudos
ZachBodenner
MVP Regular Contributor

Thanks for the detailed response! So I ran the powershell command and I got an error that began: Invoke-RestMethod : {"error":{"code":"DirectApiAuthorizationRequired","message":"The OAuth authorization scheme is
required. Please add authentication scheme and try again."}}

So it turns out my issue was not so complicated as all that: I actually just had to change my authorized triggerer from anyone in my org, to just, anyone:

ZachBodenner_0-1786389702532.pngZachBodenner_0-1786389702532.png

Now I'm not done with the whole thing yet, so I might have another question, but for now I'll mark your response as a solution!

Happy mapping,
- Zach
0 Kudos
OlaIHamed
Occasional Contributor

Glad you got it working, Zach!

That makes sense. The "Anyone in my organization" trigger requires Microsoft Entra ID authentication, which ArcGIS Server doesn't provide when sending webhook requests. Changing it to "Anyone" is the right approach.

One thing to keep in mind: with the trigger set to "Anyone", the endpoint is publicly accessible. The URL itself is long and random, so it's unlikely someone would guess it, but if you want an extra layer of security,
you could configure a Signature Key/Secret when creating the webhook and validating it in your Power Automate flow for an extra layer of security.

Thanks for following up with the solution. It'll definitely help the next person who runs into the same issue.

Happy mapping!
Ola

0 Kudos