I Built an AI That Turns Business Central Telemetry Into GitHub Issues (Automatically)
Demo of a daily Azure Logic App that queries Business Central telemetry in Application Insights with KQL for RT00002 database lock timeout events. It passes the events and the repository's AL files to an AI prompt and creates GitHub issues with root cause, resolution checklist and prevention tips. It also covers the blob storage watermark, GitHub labels created through the REST API, and deploying with Bicep/YAML templates.
- Introduction and overview of telemetry triage tool
- Solution architecture and GitHub issue generation
- Video agenda and demo plan
- Visual Studio Code demo - table, codeunit, and page
- Application Insights telemetry logs
- Logic app workflow and query
- AI analysis and GitHub issue resolution
- Blob storage watermark for tracking
- GitHub labels and API integration
- Infrastructure as code and expanding the solution
Overview
The video presents an automated telemetry triage tool. When the platform or custom code raises an event in Business Central, the event lands in Application Insights. A Logic App runs once a day, queries for specific events, passes them to an AI tool that also has access to the GitHub repository, and creates a GitHub issue with the event details, a root cause analysis and a proposed resolution.
The demo covers a Visual Studio Code example (table, codeunit and page), the telemetry logs in Application Insights, the Logic App workflow and KQL query, and the AI analysis. It also shows a blob storage watermark file for incremental runs, GitHub labels and REST API calls, and exporting the Azure services as infrastructure as code with Bicep or YAML. The demo only looks at RT00002 events, and the presenter says it can be expanded to other events.
Key points
- The Logic App is triggered once a day, queries Application Insights for chosen events, and passes the captured events with their details to an AI tool.
- The demo’s KQL query retrieves traces where the custom dimensions event ID is RT00002 (database lock timeouts) and summarizes how many times it happened since the last run.
- For each event, the logic app fetches all AL files from the GitHub repository and passes their content to the AI together with the event properties.
- The AI returns a root cause, a resolution checklist, suspected lines with code analysis, and a prevention tip. These go into a GitHub issue created through the GitHub issues endpoint.
- A watermark text file in Azure Blob Storage stores the last successful run time, so the KQL query only covers new data. The logic app creates the file if it does not exist and overwrites it at the end of each run.
- GitHub labels (telemetry, performance, database lock) can be created manually or via a POST to the GitHub labels API endpoint with name and color.
- Azure resources such as the Logic App, Application Insights or a storage account can be exported as Bicep or YAML and redeployed. A Bicep file is run with ‘az deployment group create’.
Features
| Feature | Status | At |
|---|---|---|
| Automated BC telemetry triage with Azure Logic App and AI | status not stated, demoed | 0:00 |
| KQL query for database lock timeouts | status not stated, demoed | 0:44 |
| GitHub issue generation from telemetry | status not stated, demoed | 2:09 |
| AI-powered root cause analysis | status not stated, demoed | 2:45 |
| Blob storage watermark for incremental runs | status not stated, demoed | 4:30 |
| GitHub REST API for issue and label creation | status not stated, demoed | 9:15 |
| Infrastructure as Code with Bicep and YAML | status not stated | 15:43 |
AL objects mentioned
As heard in the captions. A name that matches one object page by exact type and name links to it; the others stay as named.
Not found in BC28-30: table “Table”, codeunit “Codeunit”, page “Page”.
Quotes
- 0:10 “this is an automated BC telemetry triage with Azure logic app and AI”
- 0:23 “when something uh bad happens in BC uh the platform or your uh custom code will trigger an event um and uh the event”
- 2:20 “The automation is based on logic app. Logo runs once a day. It looks for certain events.”
- 2:45 “the AI tool has also access to the GitHub repository. With those two things, the AI tool can um determine a resolution”
- 4:30 “capturing the last time when the logic app was run”
