#2340 Add opt-in unpublishOldVersions setting to unpublish stale PTE app versions after deploy
AL-Go now supports an opt-in setting to automatically unpublish old, uninstalled versions of Per Tenant Extensions after deployment, keeping the Extension Management list clean and reducing clutter.
- 9files
- 4AL files
- 0objects
Pull request · merged into main on 2026-09-17 by louagej · 9 files (+397 -6), 4 AL · feature · tier official · reviewed (checked by Opus)
What changed
- New optional unpublishOldVersions boolean property on DeployTo environment settings, disabled by default
- After deployment, the system identifies and unpublishes only versions that are uninstalled and older than an installed version of the same app
- Uses Automation API v2.0 endpoint Microsoft.NAV.unpublish to perform the cleanup
- Operation is non-fatal and wrapped in error handling to never block deployments
- Only applies to Per Tenant Extension deployment path; existing users see zero behavior change
AL objects touched
Actions/.Modules/settings.schema.json: modified, not in the BC? snapshotActions/Deploy/Deploy.ps1: modified, not in the BC? snapshotActions/Deploy/Deploy.psm1: modified, not in the BC? snapshotActions/DetermineDeploymentEnvironments/DetermineDeploymentEnvironments.ps1: modified, not in the BC? snapshot
Context
- Systems: platform
- From the description: “Automatically clean up those stale versions right after a successful deployment.”
Source: metadata of a merged pull request in microsoft/AL-Go (al-go): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).