Azure App Service Continuous Deployment Webhook doesn't work
Asked Answered
I

2

7

(I already asked in the Microsoft Forum but didn't get an answer.)

I have an App Service using a private registry with Continuous Deployment enabled. The app is running totally fine but the Webhook URL for the Continuous Deployment doesn't work.

Here's the output of an HTTP GET request to the webhook:

$ curl https://\$MySiteName:[email protected]/docker/hook
"No route registered for '/docker/hook'"

Someone in the Microsoft Forum told me to try a POST request, so here's the output of that:

$ curl -X POST https://\$MySiteName:[email protected]/docker/hook
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

I haven't found anywhere in the Microsoft Azure docs how to use the webhook.

Ipecac answered 15/2, 2019 at 17:2 Comment(2)
Does this answer your question? How to trigger manually container refreshCoagulate
@juan Looks like it's the same solution I ended up with, so technically it does answer my question, I just wish I had found that question.Ipecac
I
10

After more searching, I found this answer.

The answer suggests to do the following:

curl https://\$MySiteName:[email protected]/docker/hook -H "" -d ""

No idea why this works and I wish there was something in the Azure docs.

Ipecac answered 16/2, 2019 at 23:22 Comment(2)
what that does is invoking (with an http request) a webhook that tells Azure that "something" has happened (e.g: a new image is ready) so that Azure can pull it and run another containerExpressive
This works because using the curl flag -d (-data) implies HTTP method POST, which is the only method allowed for this webhook URLDy
T
1

Selected answer didn't work for me in 2024. But such POST request did the thing:

curl --location --request POST 'https://***'

--request defines 'POST' method.

--location follows redirect if 3XX HTTP status and "location" header are returned in response.

Termor answered 27/3 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.