We have several APIs deployed on Azure API Management and we have created alerts in AppInsights which triggers when failed APIs are detected.
However, the triggered mail has only information on count of the APIs that have failed. We specifically require the API names and more detail about the failed APIs like request body / response body / API path etc in the alert mail itself.
I guess this can be achieved by custom webhook, but I couldn't find any proper documentation on how the failed API name and other details can be fetched from the Alert payload and can be used in custom payload.
Any guidance w.r.t. custom payload example will be very helpful.
Using custom log query, action group and logic app you can get failed Api names from API management. Below are steps I followed and able to get Api names in mail.
In actions tab, added an action group that will trigger logic app and created rule.
The designer of logic app is as shown below,
In mail body, sending the body of trigger. This will include details about triggered alert.
The search result when run query in Azure app insights are,