API support for environment copy-back lifecycle and post-copy script execution
As a development team managing multiple lower environments, we want API/PowerShell endpoints to orchestrate the full copy-back workflow, including a mechanism to run registered post-copy maintenance scripts, so that I can automate environment refresh end-to-end without manual PaaS Portal interaction.
Currently, the copy-back workflow requires manual steps in the PaaS Portal (stop environment, copy databases/blobs from Production, start environment). After the copy, teams must anonymise PII from the copied databases to comply with GDPR before the environment can be used. This anonymisation step cannot be triggered or orchestrated through the platform.
We would like the EpiCloud module or REST API to expose:
- Stop/start an environment without triggering a code deployment
- Copy database and blobs from one environment to another
- A webhook or callback when the copy operation completes (so we know when to start the anonymisation or "post-copy scripts")
- The ability to register and execute approved SQL scripts as a post-copy step (e.g. PII anonymisation, index rebuilds, configuration updates for non-production)
- A completion report confirming which scripts ran successfully, for GDPR compliance audit evidence
Option 4 could take the form of a "post-copy scripts" folder in the project repository that the platform executes automatically after a copy completes, or a managed script execution endpoint that accepts pre-registered/approved scripts.
This would allow teams to build compliant, scheduled, hands-off environment refresh pipelines without needing direct database access, which most hosted customers do not have.