Environment Promotion
The standard deployment pattern for App Studio apps is export from Dev, import to Staging, test, then import to Production. The same JSON bundle flows through all environments — no manual re-building required at each stage.
The Three-Environment Promotion Pattern
Design and iterate on the app in the Dev tenant. Connect to Dev data sources and workflows. When the release is ready, export the app bundle with a version label.
Import the bundle to the Staging tenant using Replace strategy. Connect Staging data sources. Run UAT and integration tests. Do not edit the app in Staging — any required changes go back to Dev and re-export.
Export the same bundle that passed Staging testing (or use the same file). Import to Production tenant using Replace strategy. Production gets the exact same app definition as Staging.
Environment-Specific Configuration
Some configuration is environment-specific and cannot be in the bundle. After each import, configure these manually in the target environment:
| Config item | Where to configure after import |
|---|---|
| Data source endpoint URLs | App Studio App Settings → Data Sources |
| Credential IDs for authenticated data sources | App Studio App Settings → Credentials |
| Workflow IDs (if they differ per environment) | Widget action configs in the designer |
| Allowed roles (if tenant roles differ per environment) | App Studio App Settings → Security |
Keeping Dev, Staging, and Prod Aligned
Key rules to maintain environment integrity:
- Dev is the source of truth — never edit an app directly in Staging or Production
- Always use Replace strategy for environment promotion — ensures Staging/Prod exactly match Dev
- Tag each export with a version label that matches your release version control
- Store bundles in git — commit the export JSON to source control alongside the rest of the release artifacts
- Keep a rollback bundle — before each production import, export the current production app as a rollback snapshot
CI/CD Integration
Use the Export/Import API to automate promotion in your deployment pipeline:
# Example: GitHub Actions deployment step
- name: Promote App to Production
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.PROD_API_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{ \"bundle\": $(cat crm-app-1.4.2.appstudio.json), \"conflictStrategy\": \"replace\" }" \
https://api.bizfirstai.com/tenants/acme-prod/apps/import