Business Central Telemetry, Getting started with Application Insights.
Business Central emits telemetry data for various activities and operations
on tenants.
and extensions. Monitoring telemetry gives insight into activities and tenant
health,
so you can analyze operations and diagnose problems that can affect
performance and ultimately impact the business.
This video shows how to enable Business Central to emit
telemetry data to an Azure Application
Insights resource. We'll create an Application Insights resource in the
Azure portal.
Configure Business Central environments for emitting telemetry. For Business
Central online, we'll use the tenant admin center. For on-
premises, we'll use PowerShell commandlets.
Finally, we'll configure our Business Central app in the app.json
manifest file.
Let's jump right in and create a resource.
We have an Azure subscription, and in the Azure portal
we'll search for application insights.
On the Application Insights page,
we'll choose Create, and then enter some details about our
subscription and resource group, and provide a name for the
resource.
We can choose between a workspace-based Application
Insights, or a Classic Application Insights resource.
The workspace-based Application Insights stores the data in the
log analytics and enables all features in Azure Monitor.
Depending on our needs, we can choose either one.
For this video, we'll choose Classic.
Now we'll choose Review and create, and then Create.
Here's our newly created Azure Application Insights Resource Overview page.
We'll choose Go to resource to view the details. At
the top right there's an identifier called
Instrumentation Key. We'll need this key to be able to
write data to Application Insights,
so we'll copy it by clicking the copy icon next
to the value.
We can enable Application Insights on an environment or extension
level.
This video focuses primarily on enabling Application Insights for an
environment,
but we'll also briefly show how to configure the app.json
manifest file for an extension.
Let's configure our Business Central online environment to emit telemetry
to our Application Insights resource in our tenant admin center.
We'll choose the environment, and click Application Insights Key.
This opens a dialog where we'll paste the instrumentation key
we copied from the Azure portal.
Saving the instrumentation key will restart the environment,
which stops all user and background sessions
so we should probably do this at a time when
this will not impact our users.
For example, after working hours.
It takes around five minutes for the environment to get
back online. After the instrumentation key is saved,
the value is displayed in the Environment Details section in
the tenant admin center,
and the environment will emit telemetry to Azure Application Insights.
If we have many environments to administer,
we might use the Administration Center API to set Application
Insights keys.
We won't cover that here,
but if you're interested you can read about it in
our documentation.
Using the API will also restart the environment,
so we should be careful about deciding when to do
it.
We can also use Application Insights if our environment is
on-premises in a public or private cloud.
In that case, we'll use PowerShell commandlets. For environments running
in single tenancy mode, we'll use the Set-NAVServerConfiguration
commandlet.
For environments running in multi-tenancy mode, we'll use the
Mount-NAVTenant commandlet. As of Business Central 2020 release wave
2,
we can also enable Application Insights on a per-extension
basis.
We add the instrumentation key to the extensions manifest,
the app.json file. When the extension is installed in
an environment,
telemetry will begin to flow to the Application Insights resource.
And that's it.
To learn more about partner telemetry in Azure Application Insights,
visit aka.ms/bctelemetry.
Thanks for watching.
If you want to learn more about using telemetry with
Business Central,
we also have videos about using standard Power BI reports
to analyze performance and triage errors, and troubleshoot using Jupiter
notebooks.