question

SimranKaurDeol-1049 avatar image
0 Votes"
SimranKaurDeol-1049 asked ryanchill answered

Log query for specific failed URL test Azure

Hi everyone,

I'm relatively new to Azure and currently working on custom Availability functions for multi-URL ping test.

I've applied alerts in case a URL fails but in the mail it doesn't mention which URL's test has failed.

I tried log query but couldn't land up anywhere. The max I get is as follows -

200311-image.png

Please let me know if there's a way to do it.




azure-monitorazure-webapps-availability
image.png (160.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
1 Vote"
ryanchill answered

Hi @SimranKaurDeol-1049,

Apologies for the delayed response. I'm assuming you created an URL ping test by following this doc, if not please comment let me know how you created the test. I think the query you're looking for is

availabilityResults
| where timestamp > ago(2d)
// see results for a specific test
// | name == "<availability test name>"
| extend durationInSeconds = duration / 1000
// limit samples to work with 'render scatterchart'
| take 5000
| summarize avg(durationInSeconds) by name, timestamp
| render scatterchart with (ycolumns=avg_durationInSeconds, xcolumn=timestamp)


The availability test is tied to a single URL, so you can add additional tests and this query will show you the test name in the results. So, the email that is sent should contain the actual name of the availability test in which the URL is implied. You could rename the availability test so that it contains an identifier of the URL to make it easier distinguishable.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.