Availability Tests are a great feature of Azure Application Insights. They allow you to set up active black box monitoring from points around the world so that you can measure your application’s responsiveness and availability from outside of your environment. There is one snag however: the built-in availability tests originate from hosts on the public internet which means your web app must be exposed for the tests to succeed.
In this post I’ll show you how you can run your own availability tests from a host with access to your application using PowerShell, and then send the results to App Insights using my module PSCoreAppInsights. The tests could be run by anything that has the ability to run a PowerShell script, however in this example I’ll be using a VNet integrated Azure Function.