bcquality/microsoft/knowledge/privacy/session-logmessage-requires-dataclassification.md
Jesper Schulz-Wedde 2b5550c346
Some checks failed
Validate knowledge index / validate-index (push) Has been cancelled
Validate AL review fixtures / validate-review-fixtures (push) Has been cancelled
Validate frontmatter and structure / validate (push) Has been cancelled
Improve partner onboarding and documentation navigation (#174)
Lead with a complete plugin quick start and add task-oriented usage, troubleshooting, customization, and contribution guides. Preserve the broader plugin framing, correct conflicting contract guidance, support Agents folder reviews, and align repository validation. Convert existing sample references to clickable links without changing knowledge rules.

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 17:31:03 +02:00

1.7 KiB

bc-version domain keywords technologies countries application-area
all
privacy
session-logmessage
telemetry
data-classification
verbosity
telemetry-scope
al
w1
all

Every Session.LogMessage call must specify DataClassification

Description

Session.LogMessage writes a record to the telemetry pipeline. The platform requires the call to carry an explicit DataClassification argument so that the entry can be routed and retained correctly downstream — telemetry consumers, GDPR exports, and Application Insights dashboards all rely on it. The compiler accepts overloads without the parameter (the two-argument and three-argument shapes that omit it), but for any telemetry that ships to customers, the DataClassification-bearing overload is the correct one.

Best Practice

Use the overload that takes Verbosity, DataClassification, and TelemetryScope. For payload-free operational telemetry that does not embed customer data, DataClassification::SystemMetadata is the right value. Choose TelemetryScope::ExtensionPublisher for telemetry meant for the publishing partner only; TelemetryScope::All also forwards to the customer's tenant telemetry.

See sample: session-logmessage-requires-dataclassification.good.al.

Anti Pattern

Calling Session.LogMessage('0003', 'Operation completed', Verbosity::Normal) — the overload omits DataClassification and leaves the platform without the information needed to classify the entry. Detection signal: a Session.LogMessage call whose argument list ends at Verbosity.

See sample: session-logmessage-requires-dataclassification.bad.al.