Skip to content

Admin API for PTE publishing/installing for BC30 and later - #2425

Draft
spetersenms wants to merge 3 commits into
microsoft:mainfrom
spetersenms:spetersen-microsoft-pte-al-go-integration
Draft

spetersenms wants to merge 3 commits into
microsoft:mainfrom
spetersenms:spetersen-microsoft-pte-al-go-integration

Conversation

@spetersenms

@spetersenms spetersenms commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

❔What, Why & How

From BC30 and later we will use the new Admin API to handle PTE publishing and installing. This is due to the old API getting deprecated.

All new deployment logic is handled 100% by AL-Go and does not rely on BcContainerHelper. Cleanup of old versions are now automated by the environment with no options for a manual API call, which means the unpublishOldVersions setting is deprecated already and only relevant for BC29 and below.

Deployments using the new API require additional Admin Center permissions, which is documented.

Related to issue: #

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation omits that Scope Dev deployments installing or upgrading PTE dependencies on BC 30+ still require additional Admin Center API authorization and can fail without it.

1 open issue
What changed in this PR

This PR moves AL-Go’s PTE publishing and installation to the Admin Center API for Business Central 30 and later, while preserving legacy publishing for earlier versions.

Changes:

  • Adds a shared, version-aware publisher with multipart uploads, operation polling, and bounded retries for transient status failures.
  • Routes primary apps and PTE dependencies through the shared publisher and skips explicit old-version cleanup on BC 30+.
  • Adds deployment tests and documents authorization requirements and service-managed cleanup.
File Description
Workshop/​ContinuousDeployment.md Documents authorization and cleanup behavior.
Tests/​UnpublishOldAppVersions.Test.ps1 Tests cleanup version boundaries and unknown versions.
Tests/​PublishPTEApps.Test.ps1 Tests routing, uploads, polling, and failure handling.
Tests/​Deploy.Module.Test.ps1 Tests shared publishing for PTE dependencies.
Tests/​Deploy.Action.Test.ps1 Tests action integration and cleanup sequencing.
Scenarios/​settings.md Updates deployment authorization and cleanup guidance.
Scenarios/​RegisterSandboxEnvironment.md Adds sandbox authorization instructions.
Scenarios/​RegisterProductionEnvironment.md Adds production authorization instructions.
RELEASENOTES.md Announces authorization and cleanup changes.
Actions/​Deploy/​README.md Describes publishing behavior and permissions.
Actions/​Deploy/​Deploy.psm1 Implements shared publishing and version-aware cleanup.
Actions/​Deploy/​Deploy.ps1 Uses the shared publisher for primary PTE apps.
Actions/​.Modules/​settings.schema.json Aligns the cleanup setting description with version-specific behavior.

Review effort: Balanced


With delegated authentication (impersonation), **Scope PTE** deployment to **BC 30 or later** requires appropriate **Business Central administration center access** as well as the environment permissions. The existing **AUTHCONTEXT** credential structure and the commands above remain unchanged. See the official [Business Central administration center API documentation](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-center-api) for authentication and authorization details.

These additional permissions are not required for deployment to earlier BC versions or the sandbox development endpoint (**Scope Dev**).

This branch has not been deployed

No deployments
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.

2 participants