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. Uploaded apps use theDocumentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
published-custom-apps data set (see Data set requirement).
Data set requirement
Flows custom apps are deployed as CDF files. For security, apps must be uploaded to a CDF data set with external IDpublished-custom-apps.
Without this restriction, anyone with file upload access could deploy apps visible to all users in the project, including malicious apps. The data set requirement lets administrators control who can deploy Flows apps by scoping write access to this data set.
The deploy tool resolves the published-custom-apps data set before upload. If it does not exist, the tool tries to create it. If both lookup and creation fail (for example, because of missing permissions), deployment fails with an error.
Administrators should create the published-custom-apps data set in the CDF project and grant write access to users or service accounts that deploy apps.
Interactive deployment
The simplest path uses your browser for sign-in—no OAuth configuration in the terminal:- Build your app.
- Open a browser window for you to sign in to CDF.
- Prompt you to select a deployment target from
app.json. - Package and deploy to your configured project.
- Show a link to your deployed app.
Options
Draft and published versions
apps deploy uploads your app as a Draft version. To publish and activate it, see App lifecycle.
--published flag is used for legacy apps:| Scenario | Behavior |
|---|---|
Legacy app, --published flag | Honored — deploys as published |
App Hosting app, --published flag | Warning printed, flag ignored — always deploys as DRAFT. Use apps publish . / apps activate . instead |
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):Activate a version
Set the current version as ACTIVE (the version users see). Publish the version if it’s still DRAFT:Automated deployment (CI/CD)
For CI/CD pipelines, configure client credentials.Prerequisites
- OAuth client — A client ID registered in your CDF project.
- Client secret — The secret for that client.
- Permissions — The
apphosting:readandapphosting:writecapabilities assigned to the client (apphosting:runis for end users running apps, not needed for deployment). See Flows access control.
Step 1: Configure app.json
AdddeployClientId and deploySecretName to your deployment configuration:
| Field | Description |
|---|---|
name | Display name in CDF |
externalId | Unique identifier (kebab-case) |
versionTag | Semantic version |
deployClientId | OAuth client ID |
deploySecretName | Environment variable name for the secret |
idpType | Identity provider (cdf or entra_id). Defaults to cdf |
tenantId | Microsoft Entra tenant ID (required when idpType is entra_id) |
published | Legacy field: whether the app is visible to end users. Prefer apps publish / apps activate for App Hosting apps. |
Microsoft Entra ID deployment
SetidpType to entra_id and provide tenantId:
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:Step 3: Deploy
- Build your app (
tsc && vite build). - Package
dist/into a zip. - Authenticate with client credentials.
- Upload through the CDF Files API.
- Make the app available in CDF.
Preview deployments
For pull request previews:Multiple environments
Add multiple entries todeployments:
Versioning
UpdateversionTag in app.json for each release:
Troubleshooting
What permissions do I need to deploy?
Your OAuth client (for CI/CD) or user account (for interactive deployment) needsapphosting:read and apphosting:write. apphosting:run is for end users running apps and is not required for deployment. See Flows access control.
”Deployment secret not found”
Ensure the environment variable name matchesdeploySecretName:
“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
- Confirm you have access to the CDF project.
- Ensure pop-ups are not blocked.
- Try
npx @cognite/cli@latest apps deploy --interactive --org your-orgas a hint.
Further reading
- Get started with Flows — Create an app and first deploy.
- Run your app locally — Dev server, HTTPS, and troubleshooting.
- App lifecycle — Draft, published, and active versions.
- Auth API — Tokens and SDK usage related to deployment identities.