{"title":"Set up telemetry in an extension","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-application-insights-for-extensions/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-application-insights-for-extensions, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-application-insights-for-extensions","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Configure a Business Central extension to send telemetry to Azure Application Insights, monitor deployed apps, and add feature or custom telemetry events.","date":"2026-10-09","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Set up telemetry in an extension","slug":"set-up-telemetry-in-an-extension","at":0,"chars":4193},{"level":2,"title":"Get an Application Insights resource in Azure","slug":"get-an-application-insights-resource-in-azure","at":872,"chars":477},{"level":2,"title":"Add the connection string to your extension","slug":"add-the-connection-string-to-your-extension","at":1349,"chars":1519},{"level":3,"title":"Before runtime version 7.2","slug":"before-runtime-version-72","at":2026,"chars":842},{"level":2,"title":"Add feature or custom telemetry to your AL code","slug":"add-feature-or-custom-telemetry-to-your-al-code","at":2868,"chars":817},{"level":2,"title":"Related information","slug":"related-information","at":3685,"chars":508}],"text":"# Set up telemetry in an extension\n> APPLIES TO: Business Central 2020 release wave 2 and later\nConfigure an extension to send telemetry to Azure Application Insights so that you can monitor its use, errors, and performance. The configured resource can receive eligible extension telemetry from environments where the extension is installed and telemetry emission is enabled.\nExtension telemetry helps publishers of per-tenant extensions and Marketplace apps investigate issues before partners and customers report them.\n![Diagram of extension telemetry from multiple Business Central environments flowing to one Application Insights resource.]\nTo set up extension telemetry:\n1. Get an Application Insights resource in Azure.\n1. Add the Application Insights information to the app/extension.\n1. Optionally, add feature telemetry or custom telemetry calls to your AL code.\n## Get an Application Insights resource in Azure\nCreate an Application Insights resource in Azure if you don't have one. See Create an Application Insights resource<https://learn.microsoft.com/azure/azure-monitor/app/create-workspace-resource>.\nThe Azure Application Insights resource is assigned a connection string, which you can see on the Overview page for the resource in Azure. Copy this connection string because you'll need it to enable telemetry in the app/extension.\n## Add the connection string to your extension\nStarting with runtime 7.2, add the applicationInsightsConnectionString property to your extension's app.json file, as shown in this excerpt:\n```json\n{\n    \"applicationInsightsConnectionString\": \"<ConnectionString>\"\n}\n```\nReplace `<ConnectionString>` with the connection string that you copied from the Application Insights resource. Learn more about its format in Connection strings in Application Insights<https://learn.microsoft.com/azure/azure-monitor/app/connection-strings>.\nBuild the extension package, and then publish and install it. When the extension runs, it sends eligible telemetry events to the configured resource.\n### Before runtime version 7.2\nFor runtime versions earlier than 7.2, use the legacy applicationInsightsKey property instead. Set it to the instrumentation key from the Application Insights connection string, as shown in this excerpt:\n```json\n{\n    \"applicationInsightsKey\": \"<InstrumentationKey>\"\n}\n```\nReplace `<InstrumentationKey>` with the value of InstrumentationKey in the connection string. Don't specify both applicationInsightsKey and applicationInsightsConnectionString in the same manifest.\n> NOTE\n> Support for instrumentation key-based ingestion ended on March 31, 2025. Ingestion continues to work, but Microsoft no longer provides updates or support for that feature. We recommend using connection strings. See Connection strings in Application Insights<https://learn.microsoft.com/azure/azure-monitor/app/connection-strings>.\n## Add feature or custom telemetry to your AL code\nThe platform emits eligible events associated with your extension, such as page views, incoming API requests, report execution, error dialogs, and threshold-triggered performance events. See Data logged to extension telemetry<devenv-application-insights-for-extensions-data>.\nTo log your own feature events, use the Feature Telemetry module in the System Application. Register a telemetry logger for your publisher before adding feature telemetry calls. See Using feature telemetry<../administration/telemetry-feature-telemetry>.\nTo specify custom event IDs, messages, and dimensions, use Session.LogMessage. Telemetry data-classification and privacy rules still apply. See Creating custom telemetry events<devenv-instrument-application-for-telemetry-app-insights>.\n## Related information\nGet started with AL<devenv-get-started>\ndevenv-how-publish-and-install-an-extension-v2\ndevenv-json-files\ndevenv-instrument-application-for-telemetry\nData logged to extension telemetry<devenv-application-insights-for-extensions-data>\nViewing telemetry data in Azure Application Insights<../administration/telemetry-overview>\nUsing feature telemetry<../administration/telemetry-feature-telemetry>\nCreating custom telemetry events<devenv-instrument-application-for-telemetry-app-insights>"}