Compile, publish, and debug
Compiling, publishing, debugging and signing AL extensions for Business Central in Visual Studio Code. It answers questions on breakpoints, snapshot and attach debugging, the AL Profiler, compilation scope, RAD publishing, app signing, and Entra authentication for on-premises.
Path: Development > Development environment > Compile, publish, and debug · tier official · system administration · narrative reviewed (checked by Opus)
Overview
This section covers the build-and-diagnose loop for AL developers. It includes compilation scope (OnPrem or Cloud target level), faster publishing with Rapid Application Development (RAD) and delta compilation, and signing app packages with Azure Key Vault or PFX files. It also covers Microsoft Entra authentication for on-premises and container setups used from Visual Studio Code.
Debugging has the largest share of pages. “Debugging in AL” is the starting point: breakpoints, conditional breakpoints, break on errors and record changes, SQL debugging, and database locks. Related pages cover attach and debug next, debugging upgrade and install code, snapshot debugging of production sessions, and starting a troubleshooting session from the web client. The AL Profiler helps find performance hot spots, and the MCP Server for AL lets GitHub Copilot analyze errors, call stacks and variables during a debug session.
Start with “Debugging in AL” for general debugging. Then pick the page that matches your situation: production issue (snapshot debugging or web client troubleshooting), upgrade code (debug upgrade and install code), slow code (AL Profiler), or slow builds (RAD).
Key points
- Debugging in AL uses the Visual Studio Code debugger with breakpoints, break on errors, break on record changes, SQL debugging, and database lock inspection.
- Conditional breakpoints break only when a condition is true; they support simple types, logical operators, and complex data types from version 26.
- Attach and debug next attaches to a running server without publishing first, using breakOnNext, sessionId and userId settings (2023 release wave 1).
- Snapshot debugging records production cloud sessions using snappoints and lets you inspect them offline in Visual Studio Code.
- Upgrade and install code is debugged by attaching a session and either incrementing the app version or setting the forceUpgrade flag.
- The AL Profiler records execution in instrumentation or sampling mode, configured in launch.json, and shows call stacks, timings, and SQL calls.
- RAD publishing uses delta compilation to cut build and publish times for large AL projects.
- App packages are signed with Azure Key Vault (certificates issued after June 1, 2023) or PFX files using the dotnet sign tool; self-signed certificates are for local testing only.
Learn pages
- Analyze AL Performance with the AL Profiler: Use instrumentation or sampling with the AL Profiler to analyze AL execution, SQL activity, call stacks, and performance hot spots.
- Attach and debug next: Attach to a session on a specified server and debug for Web API sessions.
- Compilation scope overview: This article explains the configuration and compilation scope for publishing the extension.
- Debug upgrade and install code: Overview of debugging upgrade and install codeunits in AL for Business Central
- Debugging in AL: Debugging in AL with Visual Studio Code and the AL Language extension.
- Setting conditional breakpoints: Overview of setting conditional breakpoints in AL.
- Sign an app package file: This article explains how to sign an AL app package file with a pfx file or with Azure Key Vault.
- Snapshot debugging: Overview of how snapshot debugging allows recording running AL code for Business Central.
- Troubleshoot in Visual Studio Code directly from the web client: Opening Visual Studio Code directly from the Business Central web client to perform troubleshooting.
- Troubleshooting MCP Server for AL: Learn how to use the Troubleshooting MCP Server to analyze runtime state during debugging sessions with AI-powered insights in AL.
- Use Microsoft Entra authentication for Business Central on-premises installations: Using Microsoft Entra ID as authentication on on-premises installations and containers for Business Central for debugging and other purposes
- Work with Rapid Application Development: Describes what Rapid Application Development is and how you publish using RAD.
Videos, posts and code changes
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- #12320 Fix 409 conflict in APIV2 Company Info E2E description test (code change): “Fixed 409 conflict errors in APIV2 Company Info E2E tests”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 8 of 12 Learn pages
- learnAnalyze AL Performance with the AL Profiler2026-10-07
- learnAttach and debug next2026-03-04
- learnCompilation scope overview2025-05-18
- learnDebug upgrade and install code2022-08-01
- learnDebugging in AL2025-08-21
- learnSetting conditional breakpoints2025-09-25
- learnSign an app package file2025-04-11
- learnSnapshot debugging2026-08-03