The AL developer environment is evolving with frequent updates. To stay up to date on the latest information and announcements, follow us on the Dynamics NAV Team Blog.

Publishing and Installing an Extension v2.0

To make your extension available to tenant users requires three basic tasks: publish the extension package to the Dynamics 365 Business Central server instance, synchronize the extension with the tenant database, and install the extension on the tenant.

Note

This article describes how to publish and install the first version of a V2 extension. If you want to publish an install newer version of an extension, see Upgrading Extensions V2.

Publish and synchronize an extension

Publishing an extension to a Dynamics 365 Business Central server instance adds the extension to the application database that is mounted on the server instance, making it available for installation on tenants of the server instance. Publishing updates internal tables, compiles the components of the extension behind-the-scenes, and builds the necessary metadata objects that are used at runtime.

Synchronizing an extension updates the database schema of the tenant database with the database schema that is defined by the extension objects. For example, if a table or table extension is included in the extension, then the respective full or companion table is created in the tenant database.

To publish and synchronize an extension

  1. Start the Dynamics NAV Administration Shell.

  2. To publish the extension, run the Publish-NAVApp cmdlet.

    The cmdlet takes as parameters the Dynamics 365 Business Central service instance that you want to install to and the .app package file that contains the extension. The following example publishes the extension MyExtension.app to the YourDynamicsNAVServer instance.

    Publish-NAVApp -ServerInstance YourDynamicsNAVServer -Path ".\MyExtension.app"
    
  3. To synchronize the schema of a tenant database to the extension, run the Sync-NavApp cmdlet.

    The following example synchronizes the extension MyExtension with the tenant:

    Sync-NavApp -ServerInstance YourDynamicsNAVServer -Name ExtensionName -Path “.\MyExtension.app” -Tenant TenantID
    

    Replace TenantID with the tenant ID of the database. If you do not have a multitenant server instance, use default or omit this parameter.

The extension can now be installed on tenants.

Install an extension

After you publish and synchronize an extension, you can install it on tenants to enable the extension and make it available to users in the client. Installing an extension can be done from the Dynamics 365 client or Dynamics NAV Administration Shell.

Note

Installing an extension will run any installation code that is built-in to the extension. Installation code could, for example, perform operations like populating empty records with data, service callbacks and telemetry, version checks, and messages to users. For more information, see Writing Extension Install Code.

To install an extension by using Dynamics NAV Administration Shell

  1. Start the Dynamics NAV Administration Shell.

  2. To install the extension on one or more tenants, use the Install-NAVApp cmdlet.

    The following example installs the extension My Extension for Tenant1 and Tenant3. In single-tenant deployments, you either specify default as the tenant ID, or you omit the –Tenant parameter.

    Install-NAVApp -ServerInstance YourDynamicsNAVServer -Name ”My Extension” –Tenant Tenant1, Tenant3  
    

To install an extension by using the client

  1. In Dynamics 365 Business Central , use search to open the Extension Management page.

    In the Extension Management window, you can view the extensions that are published to your server. For each extension, you can see the current installation status.

  2. Choose an extension to see additional information and to install the extension.

  3. Review and accept the license agreement.

  4. Choose the Install button to install the extension.

See Also

Unpublishing and Uninstalling Extensions
Developing Extensions