Control AL extension behavior with configuration files
Every AL project relies on a small set of JSON files to define its identity, its connection targets, and its editor behavior. Understanding which file owns which responsibility keeps a multi-project workspace consistent and prevents you from editing the wrong setting when a build or publish fails.
Define extension identity and dependencies in app.json
The app.json file is the project's manifest. Visual Studio Code
generates it automatically when you create a new AL project, and it
records the settings that make up the extension's identity:
- id, name, and publisher identify the extension. Since
Business Central 2021 release wave 2,
nameandpublisherare no longer part of the app's identity and can change to reflect branding, but you must incrementversionwhenever you change either one. - version is the package version. Increment it whenever you publish a new build to a shared or production environment.
- application and platform record the minimum system application, base application, and platform versions the extension targets.
- idRange or idRanges reserve the object ID ranges the extension is allowed to use. The compiler raises an error for any object created outside the declared range.
- dependencies lists other extensions the project requires, each with
an
id,name,publisher, andversion. For an app reference resolved from installed packages, the version establishes the minimum compatible version. For a project reference to another project in the same workspace, all four values must match that project's manifest, including its exact version.
The full settings reference is in JSON files.
Keep the identity fields accurate for every project in a workspace.
Because a project reference is matched by id, name, publisher, and
version, changing any of these values without updating every workspace
project that depends on it breaks reference resolution.
Configure launch targets in launch.json
The launch.json file controls how Visual Studio Code publishes and
debugs your extension. AL: Go! generates a starting configuration, and
you can add more with the Add Configuration button. For a Microsoft
cloud sandbox, a publish configuration looks similar to this excerpt:
{
"name": "Publish: Microsoft cloud sandbox",
"type": "al",
"request": "launch",
"environmentType": "Sandbox",
"environmentName": "sandbox",
"startupObjectId": 22,
"launchBrowser": true
}
The environmentType and environmentName properties determine which
Business Central environment the publish targets. The startupObjectId
property determines which page opens after publishing. launch.json
never stores a user name, password, or access token. Authentication for
a cloud sandbox happens through an interactive Microsoft Entra ID sign-in,
so keep any personal environment name in a user or workspace launch
configuration rather than in a value you commit for the whole team.
Launch settings follow a precedence order. A valid local launch.json
configuration overrides a launch property in the workspace, and a
workspace launch property overrides one in the user's settings.json.
If each developer uses a personal launch property, don't keep a valid
local AL launch configuration that overrides it in the shared project.
Also avoid committing a workspace launch property that contains one
developer's environment name.
When a workspace contains project references, launch.json also
supports a dependencyPublishingOption setting with three values:
Default applies standard dependency publishing, Strict fails the
publish if an installed app outside the workspace depends on the startup
project, and Ignore skips dependency publishing so only the startup
project deploys. Use Ignore only when you're confident the previously
published dependencies on the server already match your workspace, since
skipping dependency publishing can hide compatibility problems until
runtime. Learn more in
Launch JSON file.
Apply workspace and analyzer settings
Editor and analyzer behavior lives in settings.json, not in app.json
or launch.json. Two settings you configure most often are
al.packageCachePath, which sets the folder used to cache downloaded
symbol files, and al.enableCodeAnalysis, which turns on the code
analyzers configured for the project. You can set these values at the
user, workspace, or individual project level, so a shared workspace
setting applies to every project unless a project overrides it.
Keep each file scoped to its responsibility: app.json defines what the
extension is and what it depends on, launch.json defines where it
publishes and debugs, and settings.json defines how the editor and
analyzers behave while you work. Reviewing the correct file for a given
symptom, instead of guessing across all three, is often the fastest way
to resolve a configuration problem in a shared workspace.
app.json also supports configuration hygiene settings you set once and
rarely revisit. The suppressWarnings array lists specific diagnostic
IDs to exclude from the Output window without a ruleset file, useful
for a small, well-understood exception. The resourceExposurePolicy
object controls whether a per-tenant extension's source can be debugged
or downloaded from a development environment. Both settings affect every
developer who builds the project, so review changes to them with the
same care you apply to a dependency or version change.
Note
Two additional files, rad.json and snapshots.json, are generated to
support rapid application development publishing and snapshot
debugging. Don't edit them directly.