Skip to main content

Deploy your app

  • How-to
  • 1 minute

Permissions

To deploy your Dynatrace app, you need the following IAM permissions:

  • app-engine:apps:install
  • app-engine:apps:run

If you're planning to uninstall it completely, you might also need the following permission:

  • app-engine:apps:delete

Deploy from a local device

  1. Ensure your user has the required IAM permissions.
  2. Navigate to the root of your project.
  3. Run the following command in your terminal:
npm run deploy

Deploy from a CI/CD pipeline

  1. Create an OAuth client that has the required IAM permissions.
  2. In your CI/CD pipeline, set the environment variables DT_APP_OAUTH_CLIENT_ID and DT_APP_OAUTH_CLIENT_SECRET with the generated client ID and client secret.
  3. Run the following command within your pipeline:
npm run deploy

Examples

Jenkinsfile
pipeline {
// Replace the following lines with a Docker or Kubernetes agent with an image with node v22
agent {
kubernetes {
// Example of a Kubernetes agent
cloud 'linux-amd64'
yaml """
kind: Pod
spec:
containers:
- name: nodejs
image: node22
args:
- cat
tty: true
"""
defaultContainer 'nodejs'
}
}

stages {
stage('Install') {
steps {
sh('npm ci')
}
}

stage('Lint') {
steps {
sh 'npm run lint'
}
}

stage('Build') {
steps {
sh('npm run build')
}
}

stage('Deploy') {
steps {
sh('npx dt-app deploy --skip-build')
}
}
}
}
Note

Every time you modify the app.config.json file, you must increase the version number in the file before re-deploying the app.

If you don't increase the version number, you need to uninstall the current deployed version.

Uninstall the app

  1. Ensure your user or the OAuth token used on the CI/CD pipeline has the app-engine:apps:delete permission.
  2. Run the following command in your terminal:
npm run uninstall
Still have questions?
Find answers in the Dynatrace Community