Author : MD TAREQ HASSAN | Updated : 2020/11/24
Prerequisites
- Create Application Insights
- Application Insights Resource provider: https://portal.azure.com/#create/Microsoft.AppInsights
Adding Application Insights to APIM
- Go to resource groups: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group > API Management service
- Monitoring section > Application Insights
- Add > Select Application Insights > Enter description
- Create
- Logger (i.e. ‘insights-for-apim’) will be created and that logger will be used to configure application insights at API level settings**
Enable Application Insights
- Go to resource groups: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group > API Management service
- APIs section > APIs > Select target API
- All Operations > Settings
- Diagnostics Logs > Application Insights > Enable
- Fillup detsils
- Destination -> Select Logger (i.e. ‘insights-for-apim’) that created before
- Sampling (too much logging will slow it down)
- etc.
- Save
Metrics
- Telemetry data
- Can be sued to create charts
Creating a chart
- Go to resource groups: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group > API Management service
- Monitoring section > Metrics
- New chart (“Pin to Dashborad” if you need)
Alrets
- Create Alerts rules
- Based on condition, perform actions i.e. send notification email, trigger event etc. (i.e. Logic app, functions etc)
Creating Alert rule
- Go to resource groups: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group > API Management service
- Monitoring section > Alerts
- New Alert rule > fillup details
- Create alert rule
Activity logs
Traces changes of APIM configurations