community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Automate Business Central Extension Deployment with PowerShell and the Admin API

PowerShell automation script that deploys Business Central extensions to production by sorting them by dependencies, checking installed versions, and monitoring installation status through the Admin API. Useful when deploying multiple extensions from UAT environments or performing large-scale updates.

post Aardvark Labs

Marcel Chabot · 2026-09-25 · 1,925 words · about 9 min

"Business Central extensions often depend on other extensions. Installing them in the wrong order can cause failures."

Key points

  • Script handles dependency resolution by extracting metadata from .app files and performing topological sorting to determine correct install order
  • Version comparison prevents downgrading extensions by checking installed versions against incoming packages
  • Automated monitoring polls the Admin API until installation succeeds or fails, eliminating manual oversight
  • Multi-step process includes authentication via OAuth2, metadata extraction using 7-Zip, and multipart form-data uploads
  • Circular dependency detection throws errors to prevent infinite loops during dependency graph traversal

Quotes

  • “Business Central extensions often depend on other extensions. Installing them in the wrong order can cause failures.” (Explains why dependency sorting is critical and why the topological sort algorithm is necessary)
  • “With this script in place, deploying Business Central extensions becomes predictable, repeatable, and, most importantly, unattended.” (States the primary benefit: eliminating manual deployment work and reducing human error)

Context

  • Features: Admin API pteInstall endpoint, OAuth2 client credentials authentication, Topological dependency sorting, Version comparison, Installation status monitoring, NavxManifest.xml metadata extraction, Multipart form-data upload, Circular dependency detection
  • Versions: Admin API v2.29

Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.