Apps

Package: databricks.bundles.apps

Classes

class App

An app that runs on Databricks Apps. The app runs on managed compute in the workspace and is deployed from a workspace folder or a Git repository. Each app acts as its own dedicated service principal.

name: str

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

budget_policy_id: str | None = None

[Public Preview] ID of the serverless budget policy that the app’s compute usage is attributed to. Budget policies and usage policies are alternatives: set at most one of budget_policy_id and usage_policy_id.

compute_max_instances: int | None = None

Maximum number of app instances the app is configured to run. Must be set together with compute_min_instances.

compute_min_instances: int | None = None

Minimum number of app instances the app is configured to run. Must be set together with compute_max_instances.

compute_size: ComputeSize | None = None

Size of the compute instances the app runs on. Defaults to MEDIUM. Larger sizes provide more CPU and memory at a higher hourly cost. See https://docs.databricks.com/aws/en/dev-tools/databricks-apps/compute-size.

config: AppConfig | None = None
description: str | None = None

The description of the app.

git_repository: GitRepository | None = None

Git repository configuration for app deployments. When specified, deployments can reference code from this repository by providing only the git reference (branch, tag, or commit).

git_source: GitSource | None = None

Git source configuration for app deployments. Specifies which git reference (branch, tag, or commit) to use when deploying the app. Used in conjunction with git_repository to deploy code directly from git. The source_code_path within git_source specifies the relative path to the app code within the repository.

lifecycle: LifecycleWithStarted | None = None

Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.

permissions: list[AppPermission]

The permissions to apply to this resource.

resources: list[AppResource]

Databricks resources the app depends on. Each entry grants the app’s service principal the listed permission on one resource and makes that resource available to the app under the entry’s name.

source_code_path: str | None = None

Workspace file system path of the app source code. On create, the app is deployed from this path. Alternative to git_source.

telemetry_export_destinations: list[TelemetryExportDestination]

Destinations that receive the app’s OpenTelemetry logs, metrics and traces. Changes take effect when the app is next deployed.

thumbnail_path: str | None = None

The local path of a PNG or JPEG image of at most 250 KB to show as the app’s thumbnail in the Apps UI, relative to the defining YAML file. Removing it deletes the thumbnail.

usage_policy_id: str | None = None

[Public Preview] ID of the usage policy that the app’s compute usage is attributed to. Alternative to budget_policy_id.

user_api_scopes: list[str]

[Public Preview] API scopes the app requests for user authorization. The user access token that Databricks forwards to the app is limited to these scopes plus the default identity scopes, so the app can act on the user’s behalf only within them. Workspace admins can restrict which scopes apps in the workspace may request. See https://docs.databricks.com/aws/en/dev-tools/databricks-apps/auth.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppConfig
command: list[str]
env: list[AppEnvVar]
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppEnvVar
name: str
value: str | None = None
value_from: str | None = None
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppPermission
level: AppPermissionLevel

The permission level to apply. The allowed levels depend on the resource type.

group_name: str | None = None

The name of the group granted the permission level.

service_principal_name: str | None = None

The name of the service principal granted the permission level.

user_name: str | None = None

The name of the user granted the permission level.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppPermissionLevel

Permission level

CAN_MANAGE = 'CAN_MANAGE'
CAN_USE = 'CAN_USE'
class AppResource
name: str

Key that identifies the resource within the app. The app configuration (app.yaml) references the resource by this key.

app: AppResourceApp | None = None

Another app in the workspace that this app is granted access to.

database: AppResourceDatabase | None = None

Lakebase Provisioned database the app is granted access to.

description: str | None = None

Description of the App Resource.

experiment: AppResourceExperiment | None = None

MLflow experiment the app is granted access to.

genie_space: AppResourceGenieSpace | None = None

Genie space the app is granted access to.

job: AppResourceJob | None = None

Lakeflow job the app is granted access to.

postgres: AppResourcePostgres | None = None

Lakebase Autoscaling Postgres database the app is granted access to.

secret: AppResourceSecret | None = None

Secret the app is granted access to.

serving_endpoint: AppResourceServingEndpoint | None = None

Model serving endpoint the app is granted access to.

sql_warehouse: AppResourceSqlWarehouse | None = None

SQL warehouse the app is granted access to.

uc_securable: AppResourceUcSecurable | None = None

Unity Catalog securable (volume, table, function, connection or model service) the app is granted a privilege on.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceApp
name: str | None = None

Name of the app to grant access to.

permission: AppResourceAppAppPermission | None = None

Permission to grant on that app.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceAppAppPermission
CAN_USE = 'CAN_USE'
class AppResourceDatabase
database_name: str

Name of the database within the instance.

instance_name: str

Name of the Lakebase database instance.

permission: AppResourceDatabaseDatabasePermission

Permission to grant the app on the database.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceDatabaseDatabasePermission
CAN_CONNECT_AND_CREATE = 'CAN_CONNECT_AND_CREATE'
class AppResourceExperiment
experiment_id: str

ID of the MLflow experiment.

permission: AppResourceExperimentExperimentPermission

Permission to grant the app on the experiment.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceExperimentExperimentPermission
CAN_MANAGE = 'CAN_MANAGE'
CAN_EDIT = 'CAN_EDIT'
CAN_READ = 'CAN_READ'
class AppResourceGenieSpace
name: str
permission: AppResourceGenieSpaceGenieSpacePermission

Permission to grant the app on the Genie space.

space_id: str

ID of the Genie space.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceGenieSpaceGenieSpacePermission
CAN_MANAGE = 'CAN_MANAGE'
CAN_EDIT = 'CAN_EDIT'
CAN_RUN = 'CAN_RUN'
CAN_VIEW = 'CAN_VIEW'
class AppResourceJob
id: str

Id of the job to grant permission on.

permission: AppResourceJobJobPermission

Permissions to grant on the Job. Supported permissions are: “CAN_MANAGE”, “IS_OWNER”, “CAN_MANAGE_RUN”, “CAN_VIEW”.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceJobJobPermission
CAN_MANAGE = 'CAN_MANAGE'
IS_OWNER = 'IS_OWNER'
CAN_MANAGE_RUN = 'CAN_MANAGE_RUN'
CAN_VIEW = 'CAN_VIEW'
class AppResourcePostgres
branch: str | None = None

Resource name of the Lakebase Autoscaling branch, in the form projects/{project}/branches/{branch}.

database: str | None = None

Resource name of the database within the branch, in the form projects/{project}/branches/{branch}/databases/{database}.

permission: AppResourcePostgresPostgresPermission | None = None

Permission to grant the app on the database.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourcePostgresPostgresPermission
CAN_CONNECT_AND_CREATE = 'CAN_CONNECT_AND_CREATE'
class AppResourceSecret
key: str

Key of the secret to grant permission on.

permission: AppResourceSecretSecretPermission

Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: “READ”, “WRITE”, “MANAGE”.

scope: str

Scope of the secret to grant permission on.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceSecretSecretPermission

Permission to grant on the secret scope. Supported permissions are: “READ”, “WRITE”, “MANAGE”.

READ = 'READ'
WRITE = 'WRITE'
MANAGE = 'MANAGE'
class AppResourceServingEndpoint
name: str

Name of the serving endpoint to grant permission on.

permission: AppResourceServingEndpointServingEndpointPermission

Permission to grant on the serving endpoint. Supported permissions are: “CAN_MANAGE”, “CAN_QUERY”, “CAN_VIEW”.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceServingEndpointServingEndpointPermission
CAN_MANAGE = 'CAN_MANAGE'
CAN_QUERY = 'CAN_QUERY'
CAN_VIEW = 'CAN_VIEW'
class AppResourceSqlWarehouse
id: str

Id of the SQL warehouse to grant permission on.

permission: AppResourceSqlWarehouseSqlWarehousePermission

Permission to grant on the SQL warehouse. Supported permissions are: “CAN_MANAGE”, “CAN_USE”, “IS_OWNER”.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceSqlWarehouseSqlWarehousePermission
CAN_MANAGE = 'CAN_MANAGE'
CAN_USE = 'CAN_USE'
IS_OWNER = 'IS_OWNER'
class AppResourceUcSecurable
permission: AppResourceUcSecurableUcSecurablePermission

Privilege to grant the app on the securable. The privilege must be valid for the securable type, such as READ_VOLUME for a volume or SELECT for a table.

securable_full_name: str

Full name of the Unity Catalog securable. For volumes, tables and functions this is the three-level catalog.schema.object name.

securable_type: AppResourceUcSecurableUcSecurableType

Kind of Unity Catalog securable that securable_full_name refers to.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AppResourceUcSecurableUcSecurablePermission
READ_VOLUME = 'READ_VOLUME'
WRITE_VOLUME = 'WRITE_VOLUME'
SELECT = 'SELECT'
EXECUTE = 'EXECUTE'
USE_CONNECTION = 'USE_CONNECTION'
MODIFY = 'MODIFY'
class AppResourceUcSecurableUcSecurableType
VOLUME = 'VOLUME'
TABLE = 'TABLE'
FUNCTION = 'FUNCTION'
CONNECTION = 'CONNECTION'
MODEL_SERVICE = 'MODEL_SERVICE'
class ComputeSize
MEDIUM = 'MEDIUM'
LARGE = 'LARGE'
XLARGE = 'XLARGE'
class DependsOn
resource: str

Key of the resource to depend on, as foo or jobs.foo, or of its grants or permissions, as schemas.foo.grants.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class GitRepository

Git repository configuration specifying the location of the repository.

provider: str

Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.

url: str

URL of the Git repository.

auto_deploy: bool | None = None

When true, automatically deploys the app on push events to the branch configured in the app’s deployment_source.git_source.

caller_credential_id: int | None = None

ID of a personal access token Git credential owned by the caller, used to grant the app’s service principal access to this repository.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class GitSource

Complete git source specification including repository location and reference.

branch: str | None = None

Git branch to checkout.

commit: str | None = None

Git commit SHA to checkout.

source_code_path: str | None = None

Relative path to the app source code within the Git repository. If not specified, the root of the repository is used.

tag: str | None = None

Git tag to checkout.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class LifecycleWithStarted
depends_on: list[DependsOn]

Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering.

prevent_destroy: bool | None = None

Lifecycle setting to prevent the resource from being destroyed.

started: bool | None = None

Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class TelemetryExportDestination

A single telemetry export destination with its configuration and status.

unity_catalog: UnityCatalog | None = None

Unity Catalog tables that receive the telemetry.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class UnityCatalog

Unity Catalog Destinations for OTEL telemetry export.

logs_table: str

Three-level name of the Unity Catalog table that receives OpenTelemetry logs. The table is created if it does not exist.

metrics_table: str

Three-level name of the Unity Catalog table that receives OpenTelemetry metrics. The table is created if it does not exist.

traces_table: str

Three-level name of the Unity Catalog table that receives OpenTelemetry traces (spans). The table is created if it does not exist.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict