Unpublishing and Uninstalling Extensions
Similar to how you make an extension available to tenant users, there's also three operations that are related to the removal of an extension: uninstalling, unpublishing, and synchronizing in clean mode. Each operation provides a different level of removal:
Task | Description |
---|---|
Uninstalling an extension |
|
Unpublishing an extension |
|
Synchronizing in clean mode |
|
Uninstalling extensions
You can uninstall an extension by using the Business Central Administration Shell or from the client. You can run the synchronizing in clean mode operation as part of the uninstall operation, instead of doing it after separately.
Important
- You can't uninistall an extension if any there are other installed extensions that are dependent on the extension. If you try, you'll get a message stating that there are dependent extensions and asking you to confirm whether you want to uninstall the extension and its dependents.
- When you choose to run the synchronizing in clean mode operation when uninstalling, the database schema and data associated with dependent extensions will also be removed.
Uninstall an extension by using Business Central Administration Shell
Start the Business Central Administration Shell.
For more information, see Business Central PowerShell Cmdlets.
To get a list of the extensions that are currently installed on a tenant, run the Get-NAVAppInfo cmdlet with the
Tenant
parameter set.This cmdlet is useful when you uninstall the extension because you must provide information about the extension, like its name and version.
Get-NAVAppInfo -ServerInstance YourDynamicsNAVServer -Tenant TenantID
Replace
TenantID
with the tenant ID of the database. If you don't have a multitenant server instance, usedefault
or omit this parameter.To uninstall an extension, run the Uninstall-NAVApp cmdlet.
The following example uninstalls an extension by using its extension package file path
.\MyExtension.app
.Uninstall-NAVApp -ServerInstance YourDynamicsNAVServer -Path '.\MyExtension.app'
The following example uninstalls an extension by using its name
My Extension
and version (in this case1.0.0.0
):Uninstall-NAVApp -ServerInstance YourDynamicsNAVServer -Name "My Extension" -Version 1.0.0.0
The following example combines the Get-NAVAppInfo and Uninstall-NAVApp cmdlets into a single command:
Get-NAVAppInfo -ServerInstance YourDynamicsNAVServer -Name 'My Extension' -Version 1.0.0.0 | Uninstall-NAVApp
If you want to run synchronizing in clean mode operation, include the
-ClearSchema
parameter.
Uninstall an extension by using the client
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 installed on the tenant
Choose an extension, and choose the Uninstall action.
If you want to delete data in tables owned by the extension, turn on the Delete Extension Data switch. This action does the same as the
-ClearSchema
parameter with the Uninstall-NavApp cmldet. This action can't be undone.
For more information, see Uninstall an Extension in the business functionality help.
Delete orphaned extension data
If you want to keep the data for an uninstalled app, you can delete the data later by using the Delete Orphaned Extension Data page. The Delete Orphaned Extension Data page lists the apps that you still have data for. To delete the data, choose the app, and then choose Delete Data.
There are several reasons for why you should delete orphaned extension data. First, it frees up database capacity. Second, it reduces the row size in the companion table used to store data for extension tables. This will, in turn, speed up data operations on that table.
Unpublish extensions
You unpublish an extension on a Dynamics 365 Business Central service instance by using the Business Central Administration Shell.
Start the Business Central Administration Shell.
For more information, see Business Central PowerShell Cmdlets.
To get a list of the extensions that are currently published on a tenant, run the Get-NAVAppInfo cmdlet without the
Tenant
parameter.This is useful because a server instance can have several published extensions. Unpublishing an extension requires that you provide specific information about the extension, like the name or version.
Get-NAVAppInfo -ServerInstance YourDynamicsNAVServer
To unpublish the extension, run the Unpublish-NAVApp cmdlet. You can unpublish the extension by specifying the path to extension package file or the extension name and version.
The following example unpublishes an extension by using its extension package file path
.\MyExtension.app
.Unpublish-NAVApp -ServerInstance YourDynamicsNAVServer -Path '.\MyExtension.app'
The following example unpublishes an extension by using its name
My Extension
and version (in this case1.0.0.0
):Unpublish-NAVApp -ServerInstance YourDynamicsNAVServer -Name "My Extension" -Version 1.0.0.0
The following example combines the Get-NAVAppInfo and Unpublish-NAVApp cmdlets into a single command:
Get-NAVAppInfo -ServerInstance YourDynamicsNAVServer -Name 'My Extension' -Version 1.0.0.0 | Unpublish-NAVApp
Unpublish an extension by using the client
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 installed on the tenant.
Choose an extension where Published As is not set to Global, and choose the Unpublish action.
Synchronizing (clean mode) an extension after uninstallation
Start the Business Central Administration Shell.
For more information, see Business Central PowerShell Cmdlets. 2.Run the Sync-NAVAPP cmdlet with the
-Mode
parameter set toClean
.Sync-NAVApp -ServerInstance YourDynamicsNAVServer -Tenant 'TenantID' -Name 'My Extension' -Mode Clean
Related information
Publishing and Installing an Extension
Developing Extensions
Analyzing Extension Lifecycle Telemetry