Just wasted a couple of hours of my life helping a colleague at work troubleshooting why we got a 502 response when trying to access our application in Azure.

Regular ASP.NET Core 10 api, nothing fancy.

Using Kudu, I could see that the dotnet process worked correctly, and I could curl it from inside the "container".

But when accessing it via a browser, a 502 Bad Gateway response was returned. Weird.

First I thought that it was some kind of network policy or similar.

Just for the fun of it, I tried curling from my own computer as well.

It worked, 200 OK. Wtf.

Tried the browser again -> 502 Bad Gateway.

mindblown.gif

So curl worked, but not the browser.

Turns out, curl sends HTTP/1 requests if you don't specify that it should use HTTP/2.

When I instructed curl to send HTTP/2 requests, I got the same 502 Bad Gateway error.

Solution

Screenshot 2026-06-10 132930.png
You see that little HTTP 2.0 Proxy dropdown? For some reason, this was set to On, which means that Azure tries to talk HTTP/2 all the way to your application. Our application only runs on http, meaning that HTTP/2 is not supported.

Changing this to Off and restarting the app service -> Problem solved.