Monitoring Batch Job Errors in D365FO using Application Insights

While Dynamics 365 Finance and Operations (D365FO) includes native integration with Application Insights , the out-of-the-box capabilities still have limitations—especially when it comes to monitoring the real-time status of internal processes like batch jobs. Although batch job task exceptions are tracked , they don’t always reflect the current status of a batch job. Tasks may have failed and later been retried successfully, meaning the job is actually healthy by the time we query it—yet the historical exceptions remain in telemetry. In this post, I’ll show an alternative technique that extends the telemetry pipeline by programmatically sending custom metrics and structured data to App Insights . We’ll walk through a lightweight batch class that scans for failed batch jobs across all companies and pushes that data into App Insights as both a metric and JSON payload , enabling Kusto-based analysis, dashboards, and alerts. This approach is flexible and can easily be adapte...