Analyzing permission error trace telemetry

APPLIES TO: Business Central 2022 release wave 1 and later

When a user gets an error dialog about lack of permissions while working in Business Central, a telemetry signal is emitted. This signal can be logged in an Application Insights resource.

This telemetry data lets you identify and analyze permission problems that users may experience in Business Central.

Permission error shown

Occurs when a user gets a permissions-related error message in Business Central when they try to do an operation in the application.

General dimensions

DimensionDescription or value
messagePermission error shown
severityLevel1
user_IdThe user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. Learn more in Assign a telemetry ID to users.

Custom dimensions

DimensionDescription or value
eventIdRT0031
aadTenantIdThe Microsoft Entra tenant ID that's used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.
alObjectIdIf there's no value or the value is 0, then the permission error wasn't related to a specific object, which typically happens when permissionArea is something other than Object.
alObjectNameThe name of the AL object that the user was trying to access, like a table or page.
alObjectTypeThe type of the AL object that the user was trying to access, like a table or page.
alStackTraceThe stack trace in AL.
clientTypeThe type of client that attempted the operation, such as Background or WebClient. Learn more in ClientType option type.
companyNameThe display name of the Business Central company that was used at time of execution
componentDynamics 365 Business Central Server
componentVersionThe version number of the component that emits telemetry (see the component dimension)
environmentNameThe name of the tenant environment. This dimension isn't included for Business Central on-premises environments. Learn more in Managing environments.
environmentTypeThe environment type for the tenant, such as Production, Sandbox, Trial. Learn more in Environment types.
errorMessageThe permission error message, with private information removed.
extensionNameSpecifies the name of the extension/app.
extensionPublisherSpecifies the publisher of the extension/app.
extensionVersionSpecifies the version of the extension.
extensionIdSpecifies the ID of the extension/app.
permissionAreaThe area that the permission error is related to. Possible values include: System, Entitlement, Company, Object.
permissionTypeThe permission that the operation requires, but the user lacks. Possible values: Delete, Execute, Insert, Modify, Read, Undefined
telemetrySchemaVersionThe version of the Business Central telemetry schema.

Sample KQL code (permission error dialogs)

This KQL code can help you get started analyzing which permission error dialogs users see:

traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'RT0031'
| project timestamp
// in which environment/company did it happen
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
// in which extension/app
, extensionId = customDimensions.extensionId
, extensionName = customDimensions.extensionName
, extensionVersion = customDimensions.extensionVersion
, extensionPublisher = customDimensions.extensionPublisher
// in which object
, alObjectId = customDimensions.alObjectId
, alObjectName = customDimensions.alObjectName
, alObjectType = customDimensions.alObjectType
// which user got the error
, usertelemetryId = case(
  toint( substring(customDimensions.componentVersion,0,2)) >= 20, user_Id // user telemetry id was introduced in the platform in version 20.0
, 'N/A'
)
// error information
, clientType = customDimensions.clientType
, errorMessage = customDimensions.errorMessage
, alStackTrace = customDimensions.alStackTrace

Upgrading Extensions
Monitoring and Analyzing Telemetry
Enable Sending Telemetry to Application Insights