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: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):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.
- Capabilities — The
apphosting:readandapphosting:writecapabilities granted to the client via a group. These capabilities can be scoped to the app’sexternalIdfromapp.json. Addapphosting:runif the same client also needs to run the app. See Assign capabilities.
Step 1: Configure app.json
AdddeployClientId and deploySecretName to your deployment configuration:
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. 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 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.