Homeโ€บโšก Advancedโ€บModule 111 min read ยท 12/15

Deploying to Production

Tutorial1 exercise

Build & Deploy

  1. Build โ€” Create production bundle
    npx dt-app build
  2. Deploy โ€” Upload to your Dynatrace environment
    npx dt-app deploy
  3. Install โ€” Users install from Dynatrace Hub and grant scopes

๐Ÿ’ก Bump version in app.config.json before each deploy. Dynatrace stores multiple versions.

App Settings for Secrets

Never hardcode API keys. Use app settings:

import { settingsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const settings = await settingsClient.getSettingsObjects({
  schemaIds: "app:my.app:settings"
});
const apiKey = settings.items[0].value.apiKey;

Pre-Deploy Checklist

CheckWhy
โœ… Scopes declared in app.config.jsonMissing scopes = API calls fail silently
โœ… No hardcoded secretsSource code is visible to all app users
โœ… Version bumpedSame version = deploy rejected
โœ… Error handling on DQL queriesQueries can timeout or return empty
โœ… Loading states for async opsUsers see blank screen without them
โœ… Tested with dt-app devCatches runtime errors before deploy

โš ๏ธ After deploy, users need to install your app from the Dynatrace Hub and grant the requested scopes.

๐Ÿง  Quick Check

What command deploys your app to Dynatrace?

What's Next

Module 12 โ€” Boss Fight: build a complete 3-page app from scratch.