Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 442 forks source link

SyncTriggers failing if http used on an "https-only" app #10053

Open brettsam opened 5 months ago

brettsam commented 5 months ago

If a customer has these two settings...

...the functions host will attempt to make an http request to SyncTriggers. This will fail with a 404.

It ends up being a 404 because the request follows the following path:

There's several investigations we can make here:

  1. Does this request need to be http? https does seem to work as the GET works. Don't have much context, but here is the code.
  2. If it does have to be http in this case, we can change AllowAutomaticRedirect in the HttpClient, handle the 301 directly, and present a nice error to the customer. Or use DiagnosticEvents, etc -- but provide guidance on how to get SyncTriggers working again.
mathewc commented 4 months ago

Looks like this was added 6 years ago in this commit by @balag0 - he may help provide more context on this.

Looking in the older Kudu code here that also does an /operations/settriggers, it handles this in a different way, via HttpClient configuration. I wonder if we shouldn't just do the same thing in the host.