Skip to content

Conversation

@nelsd
Copy link
Member

@nelsd nelsd commented Dec 29, 2025

The default script (migrate.js) approach assumes direct connectivity – it logs into source and destination simultaneously and moves content. In strictly regulated or highly constrained enterprise environments, these might be isolated; direct source-to-destination transfers may be discouraged. An alternative is to export the portal content to a folder, then import from that into the next environment. This two-step process decouples the environments and allows for checkpoints or approvals in between. For example, you could run an Export from source (which uses the content API to pull down JSON and media), store those artifacts (perhaps check them into source control or attach to a pipeline artifact), then later run an Import into destination using those artifacts. Azure API Management’s content API supports this approach and cleanup.js, capture.js and generate.js leverages this but they unfortunately don't have service principals which can be configured which will be needed by the deployment pipeline to talk to APIM resource. The advantage is that you can version-control the portal content – treating it similarly to code – and implement promotion workflows with approval gates (e.g., a staging review before pushing to prod). This could also make backup possible if the customer needs to have one.

So I have updated these js files and provided 2 batch file for export and cleanupImportPublish.bat to facilitate these to be run for different environment which is decoupled

Enhance scripts with additional parameters for tenant and service principal support
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