0
votes

I want to check whether my api is working fine. I have an api which only has post requests and no GET.

The tutorial here: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-web-app-availability mentions that it is very easy to check whether a rest api is working fine.

When I write an availability test, it just asks me a url, but this is not enough for my case as it is a post request.

How to do that in App Insights? Is it not possible??

3

3 Answers

1
votes

You can use Multi-step Web Tests for this:

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-web-app-availability#multi-step-web-tests

I think current pricing is $10/month (all locations are included).

EDIT: Simple Web Tests are free.

1
votes

You can sue also some custom code to do your POST request, and report the telemetry to Application Insight. Here a .netcore sample: https://github.com/rbickel/Azure.Function.AppInsightAvailabilityTest

0
votes

If your API only has POST requests, it won't be possible to use the built-in URL ping test which only sends GET requests.
But rather than settings up a more complicated availability test, it would be easier (if possible) to add a healthcheck resource to your API. Then you could use the built-in URL ping test which will send a GET request to say "/health".

Alternatively, you can create custom availability tests which you have to run and host yourself. The Microsoft Documentation provides this Azure Function example. You could also use PowerShell as I documented on my blog.