Deploy an extension to a Business Central environment
Publishing an extension isn't a single action. It's a short, ordered sequence, and skipping or reordering a step causes symbol mismatches, lost data, or an extension that compiles but never becomes usable. This unit walks through that sequence and the choices you make at each step.
Package the extension and publish to a development sandbox
Building your project produces the .app package file that every later
step operates on. The package embeds your manifest values, so confirm
version, dependencies, and idRanges are correct before you package
an extension you intend to publish, not just to debug locally.
From Visual Studio Code, Publish (Ctrl+F5) or a Run and Debug
launch both publish the package to the sandbox named in your
launch.json configuration and install it for you. This path is
appropriate for a development or test sandbox, where you control the
data and expect to republish often:
{
"name": "Contoso sandbox (publish)",
"type": "al",
"request": "launch",
"environmentType": "Sandbox",
"environmentName": "contoso-dev",
"schemaUpdateMode": "Synchronize"
}
schemaUpdateMode controls how the platform reconciles table changes
with existing data on each publish:
- Synchronize, the default, preserves data and applies schema changes that don't conflict with it. Some structural changes, such as changing a primary key, can't synchronize and block the publish.
- Recreate drops and rebuilds every table and table extension the package defines, losing all their data. Use it only when you don't need to keep sandbox data across a publish.
- ForceSync allows more schema changes than Synchronize while still trying to preserve data, but it's intended only for development and test, never for a production environment, and it can still lose data for specific changes such as a primary key change.
Publish and install through an administrative sequence
An initial on-premises or multitenant installation, or an environment where you don't want Visual Studio Code publishing directly, uses an explicit three-step administrative sequence instead:
Publish-NAVApp -ServerInstance BC -Path .\ContosoRiskManagement_1.2.0.0.app
Sync-NAVApp -ServerInstance BC -Name "Contoso Risk Management" -Version 1.2.0.0
Install-NAVApp -ServerInstance BC -Name "Contoso Risk Management" -Version 1.2.0.0
- Publish stages the package on the server instance and validates the extension's syntax and symbols, but doesn't make it available to any tenant yet.
- Synchronize (
Sync-NAVApp) reconciles the extension's table schema with the tenant database. The administration cmdlet uses its own synchronization mode options rather than theschemaUpdateModeproperty fromlaunch.json. - Install enables the extension for the specified tenant, making its objects and permissions available to users.
When you replace an installed version with a higher version, don't run
Install-NAVApp as though the package were new. Publish and synchronize
the higher version, and then run Start-NAVAppDataUpgrade to execute its
upgrade code and enable it in place of the old version.
Respect dependency order and tenant scope
If your extension depends on another extension, that dependency must already be published, synchronized, and installed at a version at least equal to the version your manifest declares, before your extension can install. Installing extensions out of dependency order produces a missing-dependency failure rather than a partial install.
In a multitenant deployment, publishing and synchronizing an extension on the server instance makes it available, but each tenant needs its own install step. An extension published for one tenant isn't automatically enabled for another, which lets you stage a rollout tenant by tenant rather than all at once.
Verify the result and plan for rollback
After an install completes, confirm the extension's expected objects appear where users work, that any required setup page opens or completes successfully, and that existing data you expected to keep is still present. Before you install to an environment other than your own development sandbox, know how you'd recover if verification fails: for a newly installed extension with no dependents, uninstalling disables it and unpublishing removes the package. Decide separately whether the extension's stored data must be retained. For an upgrade to an already-installed extension, recovery is more constrained, which is the scenario the next unit's compatibility planning addresses.
Keep deployment evidence with the release record. At minimum, record the package version and hash, target environment and tenant, dependency versions, synchronization result, installed version, verification steps, and operator. This record distinguishes a packaging problem from an environment or dependency problem when a later deployment fails. It also confirms that the package tested in the sandbox is the same package approved for the next environment.
For the complete administrative sequence and tenant parameters, see Publish and install an extension.