Link: https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-exceptions#prior-versions-support
If the CustomErrors configuration is Off, then exceptions will be available for the HTTP Module to collect.
//If customError is Off, then AI HTTPModule will report the exception
if (filterContext.HttpContext.IsCustomErrorEnabled)
{ //or reuse instance (recommended!). see note above
var ai = new TelemetryClient();
ai.TrackException(filterContext.Exception);
}
If IsCustomErrorEnabled then it will track exception. For IsCustomErrorEnabled to be true, customError must be ON. So why does it say - If customError is Off, then AI HTTPModule will report the exception?