Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Hitting Web APP Home Page Every 5 Minutes

I have a web app on Azure and it looks like App Insights or some monitoring is pinging my home page every 5 minutes.

This is only annoying now that I have added a logging to my home page to record visit details.

Is there anything I can do about this. I tried to exclude these pings by doing:

var userHostIp = Request.UserHostAddress;
if ((string.IsNullOrEmpty(userHostIp) || !userHostIp.Equals("::1")))
{
   Logger.Log("Page Visited: Home page");
}

As the IP address I see in the logs is ::1 but this doesn't work either.

like image 788
Stackedup Avatar asked Sep 02 '25 15:09

Stackedup


1 Answers

It sounds like you have AlwaysOn enabled in your app configuration, this periodically pings your app to keep it in memory thus avoiding cold starts.

If you want to stop the pings then you can simply disable that option. Alternatively, if you want to keep the pings on but avoid logging them, then you could try a looser comparison check e.g.

userHostIp.Contains("::1")
like image 179
James Avatar answered Sep 04 '25 05:09

James