3

What would be the best way to monitor when our Azure web app is being unloaded when no requests have been made to the web app for a certain amount of time?

Enabling Logstream for the web server doesn't seem to reveal anything of use..

Any hints much appreciated!

ATV
  • 3,683
  • 3
  • 21
  • 41

2 Answers2

3

You can use Azure Application Insights to create a web test that will alert you when the site is not available anymore. It will ping your site from the data centers you select and perform some action you select (mail, webhook, etc).

Azure Application Insight - Web tests - Create test

However, if you want your web app to stay online, you could upgrade its plan to be at least basic, and under settings enable always on.

Azure Web App - Always On

kim
  • 3,249
  • 2
  • 14
  • 21
  • 1
    Here's a question that just occurred to me: if you are using uptime monitoring, will the act of requesting a page to monitor uptime count as a request and keep the web app from ever being considered idle? – Rob Reagan Mar 07 '18 at 17:53
  • I haven't personally tested it, but technically having a web test running that keeps doing requests, should keep your site from going asleep. However, the "always on" feature does more than just disable idle timeout. See https://stackoverflow.com/questions/21840983/will-always-on-setting-prevent-both-idletimeout-and-periodicrestart for a more detailed explanation. – kim Mar 07 '18 at 19:20
  • Thanks for this approach - works like a breeze! I agree that upgrading and enabling *Always On* is the best solution, alas in dev/test in our small software shop we're not able to use the more expensive plans for each Azure web app we set up.. – ATV Mar 21 '18 at 07:55
3

In addition to the kim’s response:

If you are running your web app in the Standard pricing tier, Web Apps lets you monitor two endpoints from three geographic locations.

Endpoint monitoring configures web tests from geo-distributed locations that test response time and uptime of web URLs. The test performs an HTTP GET operation on the web URL to determine the response time and uptime from each location. Each configured location runs a test every five minutes.

Uptime is monitored using HTTP response codes, and response time is measured in milliseconds. A monitoring test fails if the HTTP response code is greater than or equal to 400 or if the response takes more than 30 seconds. An endpoint is considered available if its monitoring tests succeed from all the specified locations.

Web Apps also provides you with the ability to troubleshoot issues related to your web app by looking at HTTP logs, event logs, process dumps, and more. You can access all this information using our Support portal at http://.scm.azurewebsites.net/Support

The Azure App Service support portal provides you with three separate tabs to support the three steps of a common troubleshooting scenario:

-Observe current behavior

-Analyze by collecting diagnostics information and running the built-in analyzers

-Mitigate

If the issue is happening right now, click Analyze > Diagnostics > Diagnose Now to create a diagnostic session for you, which collects HTTP logs, event viewer logs, memory dumps, PHP error logs, and PHP process report.

Once the data is collected, the support portal runs an analysis on the data and provides you with an HTML report.

In case you want to download the data, by default, it would be stored in the D:\home\data\DaaS folder.

Hope this helps.