Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure App Service returns 404 for GET / request

We have an app service which is an ASP.NET app in Azure. We have defined 200 OK response for / route. When we try to hit / endpoint from browser or Postman we get desired results. But in Azure App Insights we notice GET / request every 5 min that is failing.

DNS Configuration From the picture provided, you can see that default Azure route (qualitykitchen.azurewebsites.net) is still there as we haven't figure out a way to delete it.

404 Errors screenshot from Azure It is important to note that request that generates 404 is the default route for (qualitykitchen.azurewebsites.net) instead of the custom route that we setup via custom DNS which is (api-staging.qualitykitchen.co).

Because we’re have ‘Always On’ enabled we’re pretty sure the requests are simply Azure pinging the service to keep it alive. Unforunately it seems like it’s confused on which route to call.

Are we correct in assuming that the requests are coming from Azure? How can we direct Azure to make a call to our custom route?

like image 835
Pavle Milicevic Avatar asked Nov 02 '25 09:11

Pavle Milicevic


1 Answers

Yes, that's correct, that's the AlwaysOn agent (check User-Agent in your telemetry).

Unforunately it seems like it’s confused on which route to call.

It's not, AlwaysOn agent always calls http://{sitename}.azurewebsites.net/, disregarding custom domains. It always calls / and you can't specify a custom URL.

Simply handle that domain as well and respond 200 OK back. You can not remove the default .azurewebsites.net binding.

like image 145
evilSnobu Avatar answered Nov 04 '25 03:11

evilSnobu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!