Analyzing Azure Function integration telemetry

Azure Function integration telemetry gathers data about the success or failure of calls from Business Central to Azure Functions using the Azure Function module in the System Application.

Failed operations result in a trace log entry that includes a reason for the failure.

These events use TelemetryScope::All. Successful requests use normal verbosity (severityLevel 1). Failed requests and authorization failures use error verbosity (severityLevel 3).

Custom dimensions available in all events

The following dimensions can be available in all events described below and aren't included in the individual event documentation. Some dimensions depend on the environment or the session's permissions.

DimensionDescription or value
aadTenantIdSpecifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.
alCountryCodeSpecifies the localization for the environment, such as US or DK.
alFunctionHostThe host name of the Azure function called from Business Central, without the URL scheme or path.
alIsAdminWhether the current user is a tenant admin or delegated admin.
alIsEvaluationCompanyWhether the current company is an evaluation company.
alTenantLicenseStateThe license state of the tenant, such as Paid, Trial, Suspended, or Warning.
clientTypeSpecifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type.
companyNameThe current company name.
environmentNameSpecifies the name of the tenant environment. Learn more in Managing Environments.
environmentTypeSpecifies the environment type for the tenant, such as Production or Sandbox. Learn more in Environment Types.

Request sent to Azure function succeeded

Occurs when a request to an Azure function on the host {alFunctionHost} succeeded.

General dimensions

DimensionDescription or value
messageRequest sent to Azure function succeeded

Custom dimensions

DimensionDescription or value
eventIdAL0000I74
alStatusCodeThe HTTP status code for the request.

Request sent to Azure function failed

Occurs when a request to an Azure function on the host {alFunctionHost} failed.

General dimensions

DimensionDescription or value
messageRequest sent to Azure function failed: {alFunctionHost}

Custom dimensions

DimensionDescription or value
eventIdAL0000I7P
alStatusCodeThe HTTP status code for the request.

Sample KQL code

This KQL code can help you get started analyzing and alerting on request failures to Azure functions:

traces
| where timestamp > ago(5d) // adjust as needed
| where customDimensions.eventId == 'AL0000I7P'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, requestStatusCode = customDimensions.alStatusCode
, functionHost = customDimensions.alFunctionHost

To learn more about how to set up alerting on Business Central telemetry, see Alert on Telemetry.

Authorization failed to Azure function

Occurs when OAuth authentication with a client secret or certificate doesn't return an access token for the Azure function.

General dimensions

DimensionDescription or value
messageAuthorization failed to Azure function: {alFunctionHost}

Custom dimensions

DimensionDescription or value
eventIdAL0000I75
alErrorTextAuthorization failed to Azure function: {alFunctionHost}
alEventNameAcquiring token

Sample KQL code

This KQL code can help you get started analyzing and alerting on failures to authorize to Azure functions:

traces
| where timestamp > ago(5d) // adjust as needed
| where customDimensions.eventId == 'AL0000I75'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, errorText = customDimensions.alErrorText
, functionHost = customDimensions.alFunctionHost

To learn more about how to set up alerting on Business Central telemetry, see Alert on Telemetry.

Monitoring and Analyzing Telemetry
Enable Sending Telemetry to Application Insights
Alert on Telemetry
Connecting to Azure Functions
Overview of the Application