Reputation: 671
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://learn.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?
Upvotes: 1
Views: 3992
Reputation: 7164
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.
Upvotes: 1
Reputation: 427
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
Upvotes: 1
Reputation: 6241
You can use Multi-step Web Tests for this:
I think current pricing is $10/month (all locations are included).
EDIT: Simple Web Tests are free.
Upvotes: 2