We are using Application Insight and have added a couple of web tests to monitor our site. The web tests are all run from three locations every 5 minutes and all three locations need to fail within 5 minutes for the alert to go off.
Is there some report in Application Insights that we could use to report availability for the previous month to our customer? We would need the availability percentage with at least one decimal.
UPDATE: Based on the answer by @ZakiMa I ended up with the following query:
let lastmonthstart = startofmonth(now(), -1);
let lastmonthend = endofmonth(lastmonthstart);
availabilityResults
| where timestamp between(lastmonthstart .. lastmonthend)
| summarize failurecount=countif(success == 0), successcount=countif(success == 1) by name, bin(timestamp, 5m)
| project failure = iff(failurecount > 0 and successcount == 0, 1, 0), name, bin(timestamp, 5m)
| summarize totalFailures = sum(failure), totalTests = count(failure) by name
| project ["Name"] = name, ["SLA"] = todouble(totalTests - totalFailures) / todouble(totalTests) * 100
| order by ["SLA"]