Skip to content

Conversation

@jniebrueggeSG
Copy link

Summary

This PR adds a new optional switch parameter unpublishOldVersions to the Publish-PerTenantExtensionApps function that automatically unpublishes old versions of apps after successfully upgrading to a new version. This is mentioned in #2808 and #4046.

Changes

Added unpublishOldVersions switch parameter to function signature
Implemented logic to unpublish old app versions using the Microsoft.NAV.unpublish API endpoint
Added version check to ensure the unpublish API is only called on Business Central versions 25.4.0.0 and later (when the new unpublish API became available)
Updated function documentation to include the new parameter

Technical Details

The unpublish operation only occurs when:
The unpublishOldVersions switch is explicitly provided
An app is being upgraded (not newly installed)
The Business Central version is 25.4.0.0 or later
The upgrade operation completes successfully
Uses the Microsoft.NAV.unpublish API endpoint available in the automation API

Breaking Changes

None - this is an additive change that maintains full backward compatibility.

@jniebrueggeSG jniebrueggeSG requested a review from a team as a code owner January 7, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant