Failed healthchecks, http 50x errors in webapp container as afd origin (single instance origin groups)

WestCoastSolutionArch 21 Reputation points
2025-03-29T07:03:54.9366667+00:00

I have an afd instance with two different origin groups (one to web app backend, and one to a file upload receiver server. The health checks are not functioning consistently, making me suspicious that there may be something else going on. When health checks are passing, endpoint is returning 50x errors (perhaps related to CORS, which appears to be configured for any origin, as needed by project requirements). As far as I can tell, and AI assist docs have indicated, things should be configured appropriately (yet my containers keep getting terminated, possibly contributing to the 50x http errors)

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,650 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 49,281 Reputation points Microsoft Employee
    2025-04-04T05:41:43.1+00:00

    Hi @WestCoastSolutionArch ,

    Greetings.

    From the conversation you had with ChaitanyaNaykodi-MSFT, I take it that

    • You have two applications, app1 and app2 - they are Azure App Service
    • You confirmed that app1 works, but not app2
    • You also mentioned that app2 has a Private EndPoint (PE)
    • Accessing the app2 from a VM in the VNET where the PE resides, gives you 200 responses.

    Please let me know if this is incorrect.

    My follow up questions would be,

    • Are you trying to
      • route requests to a single endPoint to 2 different Origins, app1 and app2 via Path matching, i.e., single AFD endpoint with 2 routes ?
      • or created 2 separate endPoints, each with it's own Origins app1 and app2 and own routes?
    • You mentioned you are using a Private EndPoint and you are able to access the App Service only via a VM in same VNET as the PE
    • I see you got 200 responses when you access app2 via VM.
      • As mentioned by ChaitanyaNaykodi-MSFT, "curl" by default would use port 80 only. Also, if you specify "https" , it would use 443 only. Please run,
    curl http://app2-randomstring.<region>.azurewebsites.net:8080/onsite/report/healthcheck -I
    
      • Can you also run nslookup app2-randomstring.<region>.azurewebsites.net ? from this VM

    Analysis:

    • AFAIK - your webapp is running in Port 80 only
    • I tried to curl your web app on
      • Port 80 - Getting 403 (meaning network blocked me, but still I was able to get a response)
      • Port 8080 - No response, timed out

    As next steps,

    • From your screenshot, I do see that you have created a AFD Premium Private endPoint, so this should be fine.
    • For testing
      • You can change the port to 80 in the Origin configuration.
      • If this works, it simply means your application is running on Port 80 all along
    • In that case, you can refer to Configure port number to set the port to 8080

    NOTE: If you have single endPoint and multiple routes, this is how it would look like,

    User's image

    Hope this helps.

    Cheers,

    Kapil


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.