Deploying to Production
TutorialDeploying to Production
Development mode proxies everything through localhost. Production deployment packages your app and installs it directly in a Dynatrace environment.
Build the App
npx dt-app build
This creates a dist/ folder with the optimized bundle. The build validates your app.config.json, checks scope declarations, and bundles all dependencies.
Deploy to Your Environment
npx dt-app deploy
This uploads the built package to the environment specified in app.config.json. The app appears in the Dynatrace launcher immediately.
What Happens During Deploy
- The CLI reads
environmentUrlfromapp.config.json - Authenticates using your stored OAuth credentials
- Uploads the app package to the App Engine
- The platform installs and registers the app
- Users with appropriate permissions can launch it from the Dynatrace menu
Version Management
Update the version in app.config.json before each deploy:
{
"app": {
"id": "my.doom.dashboard",
"version": "1.2.0"
}
}
Each version is stored independently. You can roll back by activating a previous version in the Dynatrace Hub.
Environment Variables
For secrets and configuration that differ between environments, use app settings rather than hardcoded values:
import { settingsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const settings = await settingsClient.getEffectiveSettingsValues({
schemaIds: "app:my.doom.dashboard:settings",
});
Pre-Deploy Checklist
- Scopes — every SDK call must have its scope declared in
app.config.json - CSP — if you relaxed CSP for dev, tighten it for production
- Error handling — wrap all
useDqlanduseAppFunctioncalls with loading/error states - Version bump — increment the version string
What's Next
Track 3 complete. In Track 4: Boss Fight, you'll build a full capstone project combining everything you've learned.