App Insights - Availability Tests


The App Insights - Availability Tests builder is used to create Application Insights Availability Tests. You will need an Application Insights instance to run the tests. The tests can be just pinging the website and expecting response code of 200, or they can be recored Visual Studio WebTests as custom XML strings.

  • Application Insights (Microsoft.Insights/webtests)

Builder Keywords

nameSets the name of this Webtest instance.
link_to_app_insightsName or resource of the App Insight instance.
web_testAvailabilityTest.WebsiteUrl Uri to website, or AvailabilityTest.CustomWebtestXml string
locationsList of locations where the site is pinged. These are not format of Farmer.Location but AvailabilityTest.TestSiteLocation.
timeoutTimeout if the test is not responding. Default: 120 seconds.
frequencyFrequency how often the test is run. Default: 900 seconds.


open Farmer
open Farmer.Builders

let ai = appInsights { name "ai" }
let myAvailabilityTest =
    availabilityTest {
        name "avTest"
        link_to_app_insights ai
        timeout 60<Seconds>
        frequency 800<Seconds>
        locations [ 
        web_test (
            |> System.Uri 
            |> AvailabilityTest.WebsiteUrl)