Best recommended approach to handle 404 errors to /admin/host/ping for my asp.net MVC application hosted in Azure app services

S.M. Sadiq-Ur-Rahman Shifath 5 Reputation points
2024-12-23T13:42:16.81+00:00

We have an ASP.NET MVC application hosted in Azure App Services. We have enabled the automatic scaling-out option from the Azure portal (Web App > Settings > Scale Out). We noticed continuous error logs in the application insights logs mentioning the ping to the path /admin/host/ping as shown below.

app service ping errors

As per the suggestion in the MS doc, as added below, we were able to understand that this is not an issue for the application hosted in the App services. https://learn.microsoft.com/en-us/azure/app-service/manage-automatic-scaling?tabs=azure-portal#why-does-appservicehttplogs-have-log-entries-similar-to-adminhostping-with-a-404-status

However, the volume of error logs it is creating (around 10k daily) is a bit of a concern for us to monitor the logs from application insights.

My question is about the most recommended approach to handle this issue for web applications hosted in Azure App services which will help us to avoid the unnecessary logs added in the application insights. Someone please suggest the best solution.

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

1 answer

Sort by: Most helpful
  1. Sina Salam 14,551 Reputation points
    2024-12-23T23:37:49.1233333+00:00

    Hello S.M. Sadiq-Ur-Rahman Shifath,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you would like to know how you can Best recommended approach to handle 404 errors to /admin/host/ping for my asp.net MVC application hosted in Azure app services.

    The methods many uses that can cause an issue or overhead later are:

    • Disabling Availability Monitoring, which could lead to missed health issues if Azure can't perform its checks.
    • Custom Middleware which could introduces maintenance overhead and potential edge-case errors.
    • Ignoring Specific Paths, which could mask genuine issues if /admin/host/ping starts serving unexpected errors.
    • Then, Sampling Adjustment which reduces overall log visibility, which might impact monitoring of other areas.

    The best practices solution is by focusing on filtering logs and leveraging Application Insights features, you can maintain both robust health monitoring and clean log data. The links provides more detailed steps to achieve this:

    1. Filter /admin/host/ping Logs in Application Insights. - https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling#add-telemetry-processors
    2. Enable Adaptive Sampling in Application Insights. - https://learn.microsoft.com/en-us/azure/azure-monitor/app/sampling
    3. Avoid Disabling Health Checks. - https://learn.microsoft.com/en-us/azure/app-service/manage-automatic-scaling?tabs=azure-portal#why-does-appservicehttplogs-have-log-entries-similar-to-adminhostping-with-a-404-status

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

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.