Setting Up Azure Application Insights for Business Central

If you’ve read anything about monitoring Business Central—whether it’s tracking long-running queries, failed web service calls, or your own custom telemetry events—the advice always starts with, “Send it to Application Insights.” But if you haven’t set one up before, the Azure portal can feel a bit overwhelming. There are resource groups, workspaces, connection strings, and a few easy-to-miss settings that can trip you up.

This post walks through the entire setup from scratch: Creating the Azure resources, wiring the connection string into your AL extension’s app.json, and then trimming the noise with transformation rules so you’re only paying for the telemetry you actually need.

You can find the full code for the example on GitHub.

Azure AppInsights displaying Telemetry events

What We’re Building

By the end of this walkthrough, you’ll have:

  • A dedicated Resource Group in Azure to keep your Business Central telemetry resources organized.
  • A Log Analytics Workspace that stores the underlying log data.
  • An Application Insights resource connected to that workspace and ready to receive telemetry.
  • Your AL extension (or Business Central environment) configured to send telemetry to that resource.
  • Transformation rules in place to reduce data volume and cost.

Let’s get started.


Part 1: Creating the Azure Resources

All three resources are created in the Azure portal (portal.azure.com). You’ll need an active Azure subscription with permissions to create resources.

Step 1 — Create a Resource Group

A resource group is a logical container in Azure. Grouping your telemetry resources together makes them easy to find, manage, and clean up later.

 Azure Resource Group Creation

  1. Navigate to the Azure portal and sign in.
  2. Search for Resource groups in the top search bar and select it.
  3. Click + Create.
  4. Select your Subscription.
  5. Enter the Resource group name: BC-Telemetry.
  6. Select a Region close to your Business Central environment (e.g., East US, West Europe).
  7. Click Review + create, then Create.

That’s it—your container is ready.

Step 2 — Create a Log Analytics Workspace

Application Insights uses a Log Analytics workspace as its backing store. This is a workspace-based model that Microsoft now requires for all new Application Insights resources.

Log Analytics Workspace Creation

  1. In the Azure portal, search for Log Analytics workspaces and select it.
  2. Click + Create.
  3. Set the Subscription and Resource group to BC-Telemetry.
  4. Enter a Name (e.g., BC-Log-Analytics). The name must be globally unique.
  5. Select the same Region you used for the resource group.
  6. Click Review + create, then Create.
  7. Wait for the deployment to complete.

Log Analytics Workspace Create

The workspace is where your raw log data lives. You won’t interact with it directly very often—Application Insights provides the query and visualization layer on top—but it’s a required piece of the architecture.

Step 3 — Create an Application Insights Resource

This is the resource that actually receives telemetry from Business Central and gives you access to querying, dashboards, and alerts.

Application Insights Resource Create

  1. In the Azure portal, search for Application Insights and select it.
  2. Click + Create.
  3. Set the Subscription and Resource group to BC-Telemetry.
  4. Enter a Name (e.g., bc-telemetry-ai).
  5. Select the same Region as your other resources.
  6. Under Resource Mode, ensure Workspace-based is selected.
  7. For Log Analytics Workspace, select the bc-telemetry-law workspace you just created.
  8. Click Review + create, then Create.

Application Insights Resource Create

  1. Once deployed, open the new Application Insights resource.
  2. On the Overview page, locate the Connection String. Copy it—you’ll need this in the next section.

Application Insights Overview

The connection string looks something like:

InstrumentationKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/;...

Keep this value handy. It’s what connects Business Central to your Application Insights resource.


Part 2: Adding the Connection String to Your AL Extension

Once your Application Insights resource is ready, you need to tell Business Central where to send telemetry. There are two places you can configure this:

  • Environment level — An admin configures Application Insights on the Business Central environment itself (in the Business Central admin center). This captures all platform and extension telemetry for that environment.
  • Extension level — You add the connection string to your extension’s app.json. This captures telemetry scoped to your extension (specifically events emitted with TelemetryScope::ExtensionPublisher or TelemetryScope::All).

Both approaches can coexist—they serve different purposes. Environment-level telemetry is typically managed by the admin, while extension-level telemetry is managed by the extension publisher. This section focuses on the extension-level configuration.

Configuring app.json

Open your extension’s app.json file and add the applicationInsightsConnectionString property:

{
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "My Extension",
  "publisher": "My Publisher",
  "version": "1.0.0.0",
  "applicationInsightsConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000"
}

A few things to know:

  • The property name is applicationInsightsConnectionString (not applicationInsightsKey—the older instrumentation key approach still works but connection strings are the current recommendation).
  • This setting only controls where your extension’s telemetry goes. It doesn’t affect environment-level telemetry.
  • If you also use TelemetryScope::All in your LogMessage calls, those events will be sent to both this resource and the environment’s Application Insights resource (if one is configured).
  • The connection string is embedded in the published .app file, so treat it as non-secret. Application Insights connection strings are designed to be safe to include in client-side code—they only allow ingestion, not reading data.

Configuring the Business Central Environment (Admin Center)

If you’re an admin and want to capture environment-wide telemetry (not just a single extension), you configure Application Insights in the Business Central admin center:

  1. Open the Business Central admin center.
  2. Select the environment you want to monitor.
  3. Click Define under Telemetry in the Details section.
  4. Enable Telemetry
  5. Paste the Connection String from your Application Insights resource, into the field for the Azure Application Insights Connection String.
  6. Click Save.

Admin Center Telemetry Setup

Once saved, the environment will begin sending platform telemetry—long-running queries, web service calls, report generation times, page views, and more—to your Application Insights resource.

Verifying the Connection

After publishing your extension (or saving the environment configuration), give it a few minutes. Then open your Application Insights resource in the Azure portal and navigate to Logs. Run a simple KQL query:

traces
| where timestamp > ago(1h)
| order by timestamp desc
| take 20

If telemetry is flowing, you’ll see trace records appearing. If your extension emits custom telemetry events, you can filter for those specifically:

traces
traces
| where customDimensions.eventId startswith "al"
| order by timestamp desc

Part 3: Minimizing Data with Transformation Rules

Application Insights charges based on data volume. Business Central environments—especially busy ones—can generate a lot of telemetry. Not all of it is useful for every scenario. Transformation rules let you filter, sample, or drop telemetry data before it’s stored, which directly reduces your costs.

Why Transformation Rules Matter

Without any filtering, a production Business Central environment can easily send gigabytes of telemetry per month. Much of that might be routine page views, verbose-level traces, or events from extensions you don’t need to monitor. Transformation rules let you intercept incoming telemetry and decide what to keep.

Where to Configure Transformations

Transformation rules are configured in the Log Analytics workspace (not directly in Application Insights). They use a feature called Workspace transformations that applies KQL-based rules to incoming data.

Here’s the general approach:

  1. Open the Log Analytics workspace (bc-telemetry-law) in the Azure portal.
  2. Navigate to Tables under Settings.
  3. Find the AppTraces table (this is where Application Insights traces data lands).
  4. Click the ellipsis () next to the table and select Create transformation. Configure Transformations 1
  5. Select an existing one or create a new transformation. Give the transformation a name (e.g., FilterVerboseTraces) Configure Transformations 2
  6. Select Transformation Editor
  7. Write a KQL transformation query that filters out the events you don’t want to store.
  8. Run the transformation query to validate it against recent data. Configure Transformations 3
  9. Apply the transformation
  10. Click Next and then Create to activate the transformation.

Example Transformation Rules

Drop verbose-level traces:

source
| where SeverityLevel >= 2

This keeps only Warning, Error, and Critical traces, dropping Verbose and Information level events. Adjust the severity threshold to match your needs.

Keep specific event types you need:

source
| where Properties.eventId startswith "ALDVLPR"

This keeps events with IDs starting with ALDVLPR if you’re monitoring those.

Keep only events from your extension:

source
| where Properties.extensionName == "sessionlogmessage1"

This is aggressive but useful if you’re paying for an Application Insights resource solely to monitor your own extension.

Tips for Transformation Rules

  • Start broad, then narrow. Begin by monitoring everything for a week or two, then look at your data volumes in Application Insights to identify what’s taking up the most space. Drop what you don’t need.
  • Test with a dev environment first. You don’t want to accidentally drop important production telemetry. Validate your transformation rules against a development or sandbox environment before applying them to production.
  • Combine rules. You can chain multiple where clauses in a single transformation query to apply several filters at once.
  • Monitor costs. After applying transformation rules, keep an eye on your Application Insights billing for a week to confirm the expected reduction.

Wrapping Up

Getting Application Insights connected to Business Central is a one-time setup that pays off immediately. With a resource group, Log Analytics workspace, and Application Insights resource in place, you have a centralized location for all the telemetry your environments and extensions generate. Adding the connection string to your app.json takes one line, and transformation rules give you fine-grained control over what data you actually store and pay for.

If you’re emitting custom telemetry events from your extension—and you should be—this infrastructure is what makes them visible and queryable. Start with the basics, get telemetry flowing, and then refine with transformation rules as your data volumes grow.

Learn more:

Note: The information discussed in this article is for informational and demonstration purposes only. Azure portal interfaces and Business Central admin center options may change over time. This content was written referencing Microsoft Dynamics 365 Business Central 2025 Wave 2 online and the Azure portal as of February 2026. Always test configurations in a sandbox environment first.

Permanent link to this article: https://www.dvlprlife.com/2026/02/setting-up-azure-application-insights-for-business-central/

Leave a Reply

Your email address will not be published.