Setting up telemetry for BC environments (VAR)
A few weeks back, I published a blog post about controlling the cost of telemetry using the transformation rules. However, I found (thanks to my colleagues from Fusion5) that I don’t have any blog posts about setting up the telemetry.
If you know how to configure telemetry and/or are already using telemetry, you can skip this blog post and continue here: Use Transformation Rules to lower the costs of BC Telemetry | MSDyn365 Business Central – Tom Kapitan (kepty.cz).
Create Azure resources
Before configuring the telemetry, we must create a few things in Azure. Previously (till +/- mid 2023), we only needed Azure Application Insights, which processed and stored all data. But now, the Application Insights only processes the telemetry, but data “are stored” in Log Analytics Workspaces.
Log Analytics Workspace
First, we need to create the Log Analytics Workspace. Go to Azure Portal (portal.azure.com) and search for “Log Analytics Workspace”. You will see list of all existing workspaces (it will probably be empty or with some default workspace). Continue with the “Create” action.
Specify the subscription and the resource group (select the existing one or create a new one) and set the instance’s name. You can change the region if you need. See the picture below. Once configured, continue to tags (you do not need to change anything) and finally create the workspace.
It will probably take a minute or two, and you will be notified once the workspace is initialized.
Application Insights
Now we need to create the insights – search for and open “Application Insights” and use the action “Create”.
You will see a similar form as for the workspace – choose the subscription, resource group and name the application insights. Leave the “Workspace-based” mode (it may look differently if you read this article in 2024, as the Classic will be removed in February 2024).
Select the workspace you created in the previous step and create the app insights. It will again take a few minutes.
Configuring telemetry
We have everything we need to log telemetry from the Business Central environment. The only thing you need is the connection string from the application insights. Just copy the highlighted value you can see in the picture below.
Now open the Business Central admin portal, select the environment and use the “Define” action next to the “Application Insights Connection String”. Enable the insights and add the connection string copied from the Azure portal.
Warning: The environment will automatically restart once you confirm the connection string, so do not do this during business hours!
How can I see received telemetry signals?
Once everything is set, you can go to the “Log Analytics Workspace”, select your workspace and open the “Logs” action from the left menu. You will see a query window where you can use KQL (Kusto Query Language) to get/analyze received telemetry.
Check the latest logs using the following query to verify that the telemetry is configured properly.
AppTraces
| take 5
Don’t forget to create the transformation rule (Use Transformation Rules to lower the costs of BC Telemetry | MSDyn365 Business Central – Tom Kapitan (kepty.cz)) to limit received signals. Otherwise, you can get a really high bill, especially if your customers use some ISV addons with high web service traffic (Jet Reports, etc.).