Study guide

15.1 Telemetry Configuration & Azure Application Insights

Microsoft Dynamics 365 Business Central Developer MB-820

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Business Central Architecture & Platform Foundation

1.1 Business Central Architecture & Extensions Model 1.2 Customization Lifecycle: Cloud (SaaS) vs. On-Premises 1.3 Base Application, System Application & AppSource

2 Chapter 2: Development Environment & Configuration

2.1: Development Environment Setup: VS Code, AL: Go! Projects & Sandboxes 2.2: AL Configuration Files: app.json & launch.json Parameters 2.3: Multi-Root Workspaces & Project Dependencies

3 Chapter 3: Extension Lifecycle: Debugging, Deployment, Multilanguage & Maintenance

3.1 Debugging & Snapshot Debugging in Visual Studio Code 3.2 Extension Deployment & Schema Synchronization Modes 3.3 Multilanguage Development with XLIFF & Translation Files 3.4 Extension Maintenance, Deprecation & Breaking Changes

4 Chapter 4: Tables, Table Extensions & Data Modeling

4.1: Building Tables, Fields, Keys & Data Types 4.2: Table Extensions & Table Modifications 4.3: FlowFields, FlowFilters & Table Relations 4.4: Enums, Enum Extensions & Extensible Types

5 Chapter 5: Pages, Page Extensions & Role Centers

5.1: Page Types, Anatomy & Control Structure 5.2: Building Card, List & Document Pages 5.3: Page Extensions & Page Customizations 5.4: Role Centers, Headlines & Cue Data Modeling

6 Chapter 6: Reports & Document Generation

6.1 Report Architecture, DataItems & Dataset Design 6.2 Report Layouts: RDLC, Word, Excel & Multilanguage 6.3 Document Reports & Request Page Programming 6.4 Processing-Only Reports & Report Substitutions

7 Chapter 7: XMLports & Data Exchange

7.1 XMLport Architecture, Formats & Properties 7.2 XMLport Node Hierarchy, Triggers & Stream Manipulation

8 Chapter 8: Codeunits, Events, Triggers & Interfaces

8.1 Codeunit Types, Execution & SingleInstance Codeunits 8.2 Events, Publishers, Subscribers & Event Isolation 8.3 Interfaces, Polymorphism & Dynamic Codeunit Invocation 8.4 Installation & Upgrade Codeunits, Data Transfer & Archive

9 Chapter 9: Entitlements, Permissions & Queries

9.1 Permission Sets & Permission Set Extensions 9.2 Inherent Permissions, Inherent Entitlements & Security Scoping 9.3 Query Objects: Joins, Aggregation & Query as Report Data Source

10 Chapter 10: UI Customization, User Assistance & Onboarding

10.1 Profile Objects & Custom Page Views in AL 10.2 User Assistance: ToolTips, Teaching Tips & In-App Tours 10.3 Assisted Setup, Guided Experience & Onboarding Checklists

11 Chapter 11: Business Central Design Patterns & Data Process Model

11.1 Functional Table Types: Master Data, Supplemental & Setup Patterns 11.2 Document Standards: Header, Line, History & Journal Architectures 11.3 Data Process Model & Posting Routine Architecture

12 Chapter 12: AL Language Fundamentals, Data Types & Variables

12.1 AL Syntax, Variable Scope, Primitive & Complex Data Types 12.2 Expressions, Control Flow Statements & Built-in Functions 12.3 Access Modifiers (Public, Internal, Local) & Code Scoping

13 Chapter 13: Data Manipulation, Streams & Error Handling

13.1 Record Operations: Get, FindSet, ModifyAll & Filter Functions 13.2 Streams, File Management & TempBlob 13.3 Error Handling: ErrorInfo, TryFunctions & Collectible Errors

14 Chapter 14: Testing, Test Toolkit & Automation

14.1 Testing Architecture & the Test Toolkit 14.2 Authoring Test Codeunits & UI Handler Functions

15 Chapter 15: Telemetry, Performance Optimization & Analyzers

15.1 Telemetry Configuration & Azure Application Insights 15.2 Custom Telemetry Signals with Session.LogMessage & KQL 15.3 Performance Profiler, SetLoadFields & Query Optimization 15.4 AL Analyzers: CodeCop, AppSourceCop, UICop & PTECop

16 Chapter 16: REST Web Services & JSON in AL

16.1 HttpClient, HttpRequestMessage & REST API Consumption 16.2 JSON Processing: JsonObject, JsonArray, JsonValue & JsonToken

17 Chapter 17: API Pages, OData, Read Scale-Out & OAuth

17.1 API Pages (PageType=API), OData Web Services & REST Endpoints 17.2 Bound and Unbound OData Actions with [ServiceEnabled] 17.3 Read Scale-Out Architecture & DataAccessIntent Configuration 17.4 Microsoft Entra ID App Registrations & OAuth 2.0 Integration

15.1 Telemetry Configuration & Azure Application Insights

Key Takeaways Explain This Topic AI

Business Central streams server-side diagnostic events asynchronously to Azure Application Insights without placing locks or performance overhead on transactional database processing.

Telemetry is configured at two distinct scopes: extension-level telemetry via the applicationInsightsConnectionString property in app.json, and environment-level telemetry in the Business Central Admin Center.

The legacy applicationInsightsKey property in app.json is deprecated; modern extensions must specify applicationInsightsConnectionString to support Azure connection strings with regional endpoints.

Standard telemetry events contain rich customDimensions including eventId, extensionId, extensionName, extensionVersion, alObjectId, alObjectType, executionTime, and sqlExecutes.

Kusto Query Language (KQL) enables developers to monitor critical operational telemetry signals including slow SQL queries (RT0005), long-running AL methods (RT0018), database lock timeouts (RT0012), and unhandled extension runtime errors.

Last updated: August 2026

15.1 Telemetry Configuration & Azure Application Insights

Modern enterprise application management requires real-time visibility into runtime performance, system health, and unexpected runtime errors. Dynamics 365 Business Central features native integration with Azure Application Insights , a comprehensive Application Performance Management (APM) service within Microsoft Azure. For the MB-820 exam, developers must understand the telemetry ingestion architecture, manifest configuration properties, diagnostic event schemas, and how to author Kusto Query Language (KQL) queries to diagnose performance bottlenecks and extension errors.

1. Business Central Telemetry Architecture

The Business Central telemetry subsystem is built directly into the Business Central Server (Navision Server Tier - NST) . As business logic executes, the runtime automatically emits diagnostic telemetry events covering database operations, web service requests, report executions, user sessions, page render timings, and AL runtime exceptions. +-----------------------------------------------------------------------+

  • | BUSINESS CENTRAL CLOUD / NST RUNTIME |
  • | |
  • | [AL Runtime Logic] [Web Service Pipeline] [Data Access Layer] |
  • | │ │ │ |
  • | ▼ ▼ ▼ |
  • | (Custom Signals) (OData / API Traces) (SQL Query Timings) |
  • | │ │ │ |
  • | └──────────────────────┼───────────────────────┘ |
  • | ▼ |
  • | [Telemetry Background Emission Queue] |
  • | (Asynchronous / Non-Blocking) |
  • +---------------------------------┬-------------------------------------+
  • │ (Encrypted HTTPS Payload / Ingestion API)
  • ▼
  • +-----------------------------------------------------------------------+
  • | AZURE APPLICATION INSIGHTS & LOGS |
  • | |
  • | - Traces Table (Custom Signals, System Events, Event IDs: RT*, LC*) |
  • | - Requests Table (Incoming API & OData Calls, Page Views) |
  • | - Exceptions Table (Unhandled AL Runtime Errors, Call Stacks) |
  • | - Performance Metrics (Execution Duration, SQL Row Counts) |
  • +---------------------------------┬-------------------------------------+
  • │ (Kusto Query Language / KQL)
  • ▼
  • +-----------------------------------------------------------------------+
  • | MONITORING, ALERTS & VISUALIZATION |
  • | - Azure Log Analytics & KQL Workbooks |
  • | - Azure Monitor Alert Rules (Automated Email / SMS / Webhooks) |
  • | - Power BI Telemetry Performance Dashboards |
  • +-----------------------------------------------------------------------+
  • Key Architectural Principles

Asynchronous Non-Blocking Emission: Telemetry events are buffered in-memory and dispatched to Azure Application Insights over background threads. Emitting telemetry never blocks user transactions, introduces database row locks, or degrades the execution speed of business routines.

Tenant Isolation: In multi-tenant cloud environments, telemetry emitted by tenant activities is tagged with tenant identifiers ( tenantId , environmentName , environmentType ), preventing cross-tenant telemetry leaks.

Emission Scopes: Business Central supports two complementary configuration tiers: Environment-Level Telemetry and Extension-Level Telemetry .

Loading diagram... Business Central Telemetry Streaming & Ingestion Architecture

2. Configuring Telemetry: Extension vs. Environment Scope

Business Central provides two distinct administrative mechanisms for directing telemetry streams to Azure Application Insights:

1. Extension-Level Telemetry ( app.json )

An Independent Software Vendor (ISV) or extension developer can configure telemetry directly within their extension's manifest file ( app.json ). This ensures that diagnostic signals, performance metrics, and unhandled errors originating exclusively from their extension are streamed directly to the ISV's private Azure Application Insights resource, regardless of where the extension is deployed. {

  • "id": "9c8b7a65-4321-4def-9876-123456789abc",
  • "name": "Contoso Advanced Logistics",
  • "publisher": "Contoso Solutions Inc.",
  • "version": "24.0.1002.0",

"applicationInsightsConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/",

  • "target": "Cloud",
  • "runtime": "13.0"
  • }

Exam Watchout — Connection String vs. Instrumentation Key: In earlier versions of Business Central, extensions used the applicationInsightsKey property containing a bare GUID instrumentation key. Microsoft has deprecated applicationInsightsKey in favor of applicationInsightsConnectionString . Connection strings are mandatory for modern cloud deployments because they embed regional ingestion endpoints, support Microsoft Entra authentication, and enhance data residency compliance.

2. Environment-Level Telemetry (Business Central Admin Center)

Tenant administrators configure environment-level telemetry within the Business Central Admin Center under the specific environment settings ( Application Insights Connection String ):

Scope: Captures all platform-wide events across the entire environment, including all installed extensions (PTEs and AppSource apps), base application posting routines, user logins, report generations, job queue executions, incoming web service calls, database lock timeouts, and capacity metrics.

Separation of Concerns: The tenant administrator sees full operational telemetry for the entire tenant, while an ISV extension developer only receives telemetry originating from their specific extension package.

Configuration Level Configuration Location What Is Captured? Primary Consumer

Extension-Level app.json ( applicationInsightsConnectionString ) Telemetry emitted by that specific extension and AL errors originating within that extension's codeunits/pages. Extension ISV / Developer

Environment-Level Business Central Admin Center ( Environment Settings ) All platform traces, web service requests (RT0008), report timings (RT0006), database lock timeouts (RT0012), slow queries (RT0005), and tenant lifecycle events across all extensions. Tenant Admin / System Integrator

3. Standard Telemetry Event Dimensions & Schema

All telemetry events in Azure Application Insights are stored within standard schema tables, with the majority of diagnostic events landing in the traces table. Every record includes standard Application Insights columns alongside rich Business Central contextual metadata encapsulated inside the customDimensions JSON dictionary.

Core Standard Columns in traces

timestamp (datetime): The precise UTC timestamp when the event was generated on the NST.

message (string): Human-readable description of the event (e.g., 'Long running SQL statement' ).

severityLevel (int): Standard logging severity ( 0 = Verbose , 1 = Information , 2 = Warning , 3 = Error , 4 = Critical ).

customDimensions (dynamic JSON): Key-value dictionary containing structured metadata emitted by Business Central.

Essential customDimensions Properties

Dimension Property Data Type Description & Example

eventId String The unique diagnostic event code (e.g., 'RT0005' , 'RT0012' , 'LC0020' ).

alObjectId Integer The integer ID of the AL object executing the code (e.g., 80 , 50100 ).

alObjectName String The human-readable name of the AL object (e.g., 'Sales-Post' , 'Logistics Engine' ).

alObjectType String The object type (e.g., 'Codeunit' , 'Page' , 'Table' , 'Report' ).

alStackTrace String The full execution call stack with line numbers where the event occurred.

extensionId GUID The immutable application GUID of the extension emitting or causing the event.

extensionName String The published name of the extension (e.g., 'Contoso Advanced Logistics' ).

extensionVersion String The 4-part semantic version string of the extension package.

executionTime Integer Execution duration measured in milliseconds .

sqlExecutes Integer Total number of physical SQL statements executed during the operation.

sqlRowsRead Integer Total number of database rows read from the database tier.

companyName String Name of the Business Central company in which the transaction occurred.

Common Diagnostic Event IDs (Exam Reference)

RT0005 ( Operation exceeded time threshold (SQL query) ): Emitted when a single SQL statement exceeds the long-running SQL query threshold — 750 ms in Business Central online.

RT0018 ( Operation exceeded time threshold (AL method) ): Emitted when a single AL method exceeds the long-running AL method threshold. Do not confuse it with RT0006 , which is report generation.

RT0006 / RT0007 / RT0011 (Report generation): Capture successful report generation, rendering failures, cancellation, and the "report cancelled but a commit occurred" case, including run duration, dataset rows, and rendering format (RDLC, Word, Excel).

RT0012 (Database Lock Timeout): Emitted when an AL transaction fails because it was blocked waiting for a SQL table/row lock held by another session.

RT0008 ( Web service called ): Captures incoming OData, SOAP, and API request durations, HTTP status codes, and endpoint paths. Outgoing calls from AL HttpClient are RT0019 . ( RT0001 – RT0004 are authorization events, not web-service events.)

LC0020 / LC0021 (Extension compiled successfully / failed to compile): Emitted during automated cloud platform update validation. LC0020 is the success signal; LC0021 is the failure you alert on, alongside LC0023 ( Extension failed to update ).

4. Kusto Query Language (KQL) for Operational Diagnostics

Developers analyze Business Central telemetry in Azure Log Analytics using Kusto Query Language (KQL) . KQL provides powerful pipeline operators ( | ) for filtering, extracting JSON properties from customDimensions , aggregating metrics, and formatting results.

KQL Query 1: Identifying Long-Running SQL Statements ( RT0005 )

This query identifies the top 10 slowest database queries over the last 24 hours, parses the execution duration and SQL statements, and groups them by offending AL object. traces

  • | where timestamp > ago(24h)
  • | where customDimensions.eventId == 'RT0005'
  • | extend
  • EventId = tostring(customDimensions.eventId),
  • ExecutionTimeMs = toint(customDimensions.executionTime),
  • AlObjectType = tostring(customDimensions.alObjectType),
  • AlObjectName = tostring(customDimensions.alObjectName),
  • AlObjectId = toint(customDimensions.alObjectId),
  • ExtensionName = tostring(customDimensions.extensionName),
  • SqlStatement = tostring(customDimensions.sqlStatement)
  • | project timestamp, ExecutionTimeMs, ExtensionName, AlObjectType, AlObjectName, AlObjectId, SqlStatement
  • | order by ExecutionTimeMs desc
  • | take 10
  • KQL Query 2: Tracking Database Lock Timeouts ( RT0012 )

Database lock timeouts cause disruptive runtime exceptions for end users. This query groups lock timeouts by the locked table and offending AL call stack to pinpoint concurrency bottlenecks. traces

  • | where timestamp > ago(7d)
  • | where customDimensions.eventId == 'RT0012'
  • | extend
  • TableName = tostring(customDimensions.tableName),
  • AlObjectId = toint(customDimensions.alObjectId),
  • AlObjectName = tostring(customDimensions.alObjectName),
  • AlStackTrace = tostring(customDimensions.alStackTrace),
  • ExtensionName = tostring(customDimensions.extensionName)
  • | summarize LockTimeoutCount = count() by TableName, AlObjectName, ExtensionName
  • | order by LockTimeoutCount desc
  • KQL Query 3: Monitoring Unhandled Extension Runtime Errors

Unhandled AL exceptions degrade user experience and trigger customer support escalations. This query extracts unhandled errors from the traces table where severity level is 3 (Error) or 4 (Critical): traces

  • | where timestamp > ago(24h)
  • | where severityLevel >= 3
  • | extend
  • EventId = tostring(customDimensions.eventId),
  • ExtensionName = tostring(customDimensions.extensionName),
  • AlObjectId = toint(customDimensions.alObjectId),
  • AlObjectName = tostring(customDimensions.alObjectName),
  • StackTrace = tostring(customDimensions.alStackTrace)

| project timestamp, message, ExtensionName, AlObjectType = customDimensions.alObjectType, AlObjectName, StackTrace

| order by timestamp desc