Enhance scripts with additional parameters for tenant and service principal support #2860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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