Skip to main content
You can deploy your Flows custom app to CDF interactively from your machine (browser sign-in, no OAuth secrets in the terminal) or automate deployment in CI/CD with client credentials.

Interactive deployment

The simplest path uses your browser for sign-in—no OAuth configuration in the terminal:
This will:
  1. Build your app.
  2. Open a browser window for you to sign in to CDF.
  3. Prompt you to select a deployment target from app.json.
  4. Package and deploy to your configured project.
  5. Show a link to your deployed app.

Options

Draft and published versions

apps deploy uploads your app as a DRAFT. If a signature is already present, the draft deploys with that signature. You can also add the signature separately. From your machine, see Signing Flows custom apps from the CLI. From a pipeline, see Signing Flows custom apps from CI/CD. To publish and activate the version, see How a version reaches Custom apps.
--published flag is used for legacy apps:For App Hosting apps, use npx @cognite/cli@latest apps publish . and npx @cognite/cli@latest apps activate . to control visibility.

App Hosting lifecycle commands

For apps using App Hosting infrastructure ("infra": "appsApi" in app.json), use the following commands to manage the version lifecycle after deployment. Each version progresses through the states: DRAFT → PUBLISHED → ACTIVE.

Check status

Print the current deployment status of your app version:

Publish a version

Transition the current version from DRAFT to PUBLISHED (visible but not yet the ACTIVE version):
This command is idempotent — re-running on an already PUBLISHED or ACTIVE version is a no-op.
Publishing requires a developer signature, including on projects with Dev status. Production projects without Dev status need both that signature and Cognite’s app certification signature (.cert.sig) from application certification. Sign from your machine with Signing Flows custom apps from the CLI, or from a pipeline with Signing Flows custom apps from CI/CD.

Activate a version

Set the current version as ACTIVE (the version users see). Publish the version if it’s still DRAFT:
If a previous version was ACTIVE, the output reports which version it replaced.
Use --interactive to authenticate via browser sign-in when running these commands from your machine:

Automated deployment (CI/CD)

For CI/CD pipelines, configure client credentials.

Prerequisites

  1. OAuth client — A client ID registered in your CDF project.
  2. Client secret — The secret for that client.
  3. Capabilities — The apphosting:read and apphosting:write capabilities granted to the client via a group. These capabilities can be scoped to the app’s externalId from app.json. Add apphosting:run if the same client also needs to run the app. See Assign capabilities.
Ask your Cognite administrator to register an OAuth client with the required permissions.

Step 1: Configure app.json

Add deployClientId and deploySecretName to your deployment configuration:

Microsoft Entra ID deployment

Set idpType to entra_id and provide tenantId:
When idpType is entra_id, Flows requests a token from Microsoft Entra ID and derives the CDF scope from baseUrl (for example, https://greenfield.cognitedata.com/.default).

Step 2: Set the secret

Export the client secret:
In CI/CD, store secrets in your platform’s secret manager (for example, GitHub Actions repository secrets, Azure DevOps variable groups, or GitLab CI variables).

Step 3: Deploy

This will:
  1. Build your app (tsc && vite build).
  2. Package dist/ into a zip.
  3. Authenticate with client credentials.
  4. Upload through the CDF Files API.
  5. Make the app available in CDF.
npm run deploy uploads a draft. If a signature is already present, the draft includes it. You can also add the signature later. See Signing Flows custom apps from CI/CD.

Preview deployments

For pull request previews:

Multiple environments

Add multiple entries to deployments:

Versioning

Update versionTag in app.json for each release:

Roll back to a published version

Each version is stored in CDF. To point Custom apps at an earlier published, Cognite-certified version, set versionTag in app.json to that version, then run:
Do not run apps deploy against that versionTag. Published versions cannot be overwritten.
See New versions and rollback for when to roll back versus recertify.

Troubleshooting

What permissions do I need to deploy?

Your OAuth client (for CI/CD) or user account (for interactive deployment) needs apphosting:read and apphosting:write. You can scope these capabilities to the app’s externalId from app.json. Add apphosting:run if the same principal also needs to run the app. See Assign capabilities.

”Deployment secret not found”

Ensure the environment variable name matches deploySecretName:

“Failed to authenticate”

Check that:
  • The client ID is correct.
  • The client secret is valid and not expired.
  • The client has the required CDF permissions (including Files API write access).

Build fails

Run the build locally:

Interactive sign-in issues

  1. Confirm you have access to the CDF project.
  2. Ensure pop-ups are not blocked.
  3. Try npx @cognite/cli@latest apps deploy --interactive --org your-org as a hint.

Further reading

Last modified on November 5, 2026