Share via


apps command group

Note

This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

The apps command group within the Databricks CLI allows you to manage apps. Apps run directly on a customer's Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on. See Databricks Apps.

databricks apps create

Create a new app.

databricks apps create NAME [flags]

Arguments

NAME

    The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. It must be unique within the workspace.

Options

--budget-policy-id string

    Budget policy ID for the app.

--description string

    The description of the app.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--no-compute

    If true, the app will not be started after creation.

--no-wait

    Do not wait to reach ACTIVE state.

--timeout duration

    Maximum amount of time to reach ACTIVE state (default 20m0s).

Global flags

Examples

The following example creates a basic app:

databricks apps create my-analytics-app --description "Analytics dashboard app"

The following example creates an app without starting it:

databricks apps create my-data-app --description "Data processing app" --no-compute

The following example creates an app with a custom timeout:

databricks apps create my-ml-app --description "Machine learning app" --timeout 30m

databricks apps delete

Delete an app.

databricks apps delete NAME [flags]

Arguments

NAME

    The name of the app.

Options

Global flags

Examples

The following example deletes an app:

databricks apps delete my-analytics-app

databricks apps deploy

Create an app deployment for the app with the supplied name.

databricks apps deploy APP_NAME [flags]

Arguments

APP_NAME

    The name of the app.

Options

--deployment-id string

    The unique id of the deployment.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--mode AppDeploymentMode

    The mode of which the deployment will manage the source code. Supported values: AUTO_SYNC, SNAPSHOT.

--no-wait

    Do not wait to reach SUCCEEDED state.

--source-code-path string

    The workspace file system path of the source code used to create the app deployment.

--timeout duration

    Maximum amount of time to reach SUCCEEDED state (default 20m0s).

Global flags

Examples

The following example creates a deployment with auto-sync mode:

databricks apps deploy my-analytics-app --source-code-path /Workspace/Users/someone@example.com/my-app --mode AUTO_SYNC

The following example creates a deployment with snapshot mode:

databricks apps deploy my-data-app --source-code-path /Workspace/Users/someone@example.com/data-app --mode SNAPSHOT

The following example creates a deployment with a custom deployment ID:

databricks apps deploy my-ml-app --deployment-id "v1.2.3" --source-code-path /Workspace/Users/someone@example.com/ml-app

databricks apps get

Get information for the app with the supplied name.

databricks apps get NAME [flags]

Arguments

NAME

    The name of the app.

Options

Global flags

Examples

The following example gets app information:

databricks apps get my-analytics-app

The following example gets app information in JSON format:

databricks apps get my-data-app --output json

The following example gets app information using a specific profile:

databricks apps get my-ml-app --profile production

databricks apps get-deployment

Get information for the app deployment with the supplied name and deployment id.

databricks apps get-deployment APP_NAME DEPLOYMENT_ID [flags]

Arguments

APP_NAME

    The name of the app.

DEPLOYMENT_ID

    The unique id of the deployment.

Options

Global flags

Examples

The following example gets deployment information:

databricks apps get-deployment my-analytics-app v1.0.0

The following example gets deployment information in JSON format:

databricks apps get-deployment my-data-app v2.1.0 --output json

The following example gets deployment information using a specific profile:

databricks apps get-deployment my-ml-app latest --profile production

databricks apps list

List all apps in the workspace.

databricks apps list [flags]

Arguments

None

Options

--page-size int

    Upper bound for items returned.

--page-token string

    Pagination token to go to the next page of apps.

Global flags

Examples

The following example lists all apps:

databricks apps list

The following example lists apps with a specific page size:

databricks apps list --page-size 10

The following example lists apps with pagination:

databricks apps list --page-token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

databricks apps list-deployments

List all app deployments for the app with the supplied name.

databricks apps list-deployments APP_NAME [flags]

Arguments

APP_NAME

    The name of the app.

Options

--page-size int

    Upper bound for items returned.

--page-token string

    Pagination token to go to the next page of apps.

Global flags

Examples

The following example lists all deployments for an app:

databricks apps list-deployments my-analytics-app

The following example lists deployments with a specific page size:

databricks apps list-deployments my-data-app --page-size 10

databricks apps run-local

Start an app locally.

databricks apps run-local [flags]

Arguments

None

Options

--app-port int

    Port on which to run the app (default 8000).

--debug

    Enable debug mode.

--debug-port string

    Port on which to run the debugger.

--entry-point string

    Specify the custom entry point with configuration (.yml file) for the app. Defaults to app.yml.

--env strings

    Set environment variables.

--port int

    Port on which to run the app proxy (default 8001).

--prepare-environment

    Prepares the environment for running the app. Requires uv to be installed.

Global flags

Examples

The following example runs an app locally with default settings:

databricks apps run-local

The following example runs an app locally on a specific port:

databricks apps run-local --app-port 9000 --port 9001

databricks apps start

Start the last active deployment of the app in the workspace.

databricks apps start NAME [flags]

Arguments

NAME

    The name of the app.

Options

--no-wait

    Do not wait to reach ACTIVE state.

--timeout duration

    Maximum amount of time to reach ACTIVE state (default 20m0s).

Global flags

Examples

The following example starts an app:

databricks apps start my-analytics-app

The following example starts an app without waiting:

databricks apps start my-data-app --no-wait

The following example starts an app with a custom timeout:

databricks apps start my-ml-app --timeout 30m

databricks apps stop

Stop the active deployment of the app in the workspace.

databricks apps stop NAME [flags]

Arguments

NAME

    The name of the app.

Options

--no-wait

    Do not wait to reach STOPPED state.

--timeout duration

    Maximum amount of time to reach STOPPED state (default 20m0s).

Global flags

Examples

The following example stops an app:

databricks apps stop my-analytics-app

The following example stops an app without waiting:

databricks apps stop my-data-app --no-wait

The following example stops an app with a custom timeout:

databricks apps stop my-ml-app --timeout 30m

databricks apps update

Update the app with the supplied name.

databricks apps update NAME [flags]

Arguments

NAME

    The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. It must be unique within the workspace.

Options

--budget-policy-id string

    Budget policy ID for the app.

--description string

    The description of the app.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

Examples

The following example updates an app's description:

databricks apps update my-analytics-app --description "Updated analytics dashboard"

databricks apps get-permission-levels

Get app permission levels.

databricks apps get-permission-levels APP_NAME [flags]

Arguments

APP_NAME

    The app for which to get or manage permissions.

Options

Global flags

Examples

The following example gets permission levels for an app:

databricks apps get-permission-levels my-analytics-app

databricks apps get-permissions

Get the permissions of an app. Apps can inherit permissions from their root object.

databricks apps get-permissions APP_NAME [flags]

Arguments

APP_NAME

    The app for which to get or manage permissions.

Options

Global flags

Examples

The following example gets permissions for an app:

databricks apps get-permissions my-analytics-app

The following example gets permissions using a specific profile:

databricks apps get-permissions my-ml-app --profile production

databricks apps set-permissions

Set app permissions.

Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct permissions if none are specified. Objects can inherit permissions from their root object.

databricks apps set-permissions APP_NAME [flags]

Arguments

APP_NAME

    The app for which to get or manage permissions.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

Examples

The following example sets permissions using JSON configuration:

databricks apps set-permissions my-analytics-app --json '{"access_control_list": [{"user_name": "someone@example.com", "permission_level": "CAN_USE"}]}'

databricks apps update-permissions

Update the permissions on an app. Apps can inherit permissions from their root object.

databricks apps update-permissions APP_NAME [flags]

Arguments

APP_NAME

    The app for which to get or manage permissions.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

Examples

The following example updates permissions using JSON configuration:

databricks apps update-permissions my-analytics-app --json '{"access_control_list": [{"user_name": "someone@example.com", "permission_level": "CAN_MANAGE"}]}'

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use