Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
This article provides reference for keys supported by Databricks Asset Bundles configuration (YAML). See What are Databricks Asset Bundles?.
For complete bundle examples, see Bundle configuration examples and the bundle-examples GitHub repository.
artifacts
Type: Map
Specifies the artifacts to automatically build during bundle deployments that can be used later in bundle runs. Each key is the name of the artifact, and the value is a Map that defines the artifact build settings.
Tip
You can define, combine, and override the settings for artifacts in bundles as described in Override with target settings.
Added in Databricks CLI version 0.229.0
artifacts:
<artifact-name>:
<artifact-field-name>: <artifact-field-value>
| Key | Type | Description |
|---|---|---|
build |
String | An optional set of build commands to run locally before deployment. For Python wheel builds, the Databricks CLI assumes that it can find a local install of the Python wheel package to run builds, and it runs the command python setup.py bdist_wheel by default during each bundle deployment. Specify multiple build commands on separate lines.Added in Databricks CLI version 0.229.0 |
dynamic_version |
Boolean | Whether to patch the wheel version dynamically based on the timestamp of the whl file. If this is set to true, new code can be deployed without having to update the version in setup.py or pyproject.toml. This setting is only valid when type is set to whl.Added in Databricks CLI version 0.245.0 |
executable |
String | The executable type. Valid values are bash, sh, and cmd.Added in Databricks CLI version 0.229.0 |
files |
Sequence | The relative or absolute path to the built artifact files. See artifacts.name.files. Added in Databricks CLI version 0.229.0 |
path |
String | The local path of the directory for the artifact. Paths are relative to the location of the bundle configuration file. For Python wheel builds, it is the path to the Python wheel file's setup.py file. If path is not included, the Databricks CLI attempts to find the Python wheel file's setup.py file in the bundle's root.Added in Databricks CLI version 0.229.0 |
type |
String | Required if the artifact is a Python wheel. The type of the artifact. Valid values are whl and jar. This setting does not need to be specified to build other artifacts.Added in Databricks CLI version 0.229.0 |
Examples
The following configuration builds a Python wheel using Poetry:
artifacts:
default:
type: whl
build: poetry build
path: .
The following configuration runs tests and builds a wheel. For a complete bundle tutorial that uses artifacts to build a wheel, see Build a Python wheel file using Databricks Asset Bundles.
artifacts:
default:
type: whl
build: |-
# run tests
python -m pytest tests/ -v
# build the actual artifact
python setup.py bdist_wheel
path: .
For an example configuration that builds a JAR and uploads it to Unity Catalog, see Bundle that uploads a JAR file to Unity Catalog.
artifacts.name.files
Type: Sequence
The relative or absolute path to the built artifact files. Use source to specify the built artifacts. Paths are relative to the location of the bundle configuration file.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
source |
String | Required. The artifact source file. Added in Databricks CLI version 0.229.0 |
bundle
Type: Map
The bundle attributes when deploying to this target.
A bundle configuration file must contain only one top-level bundle mapping.
This bundle mapping must contain a name mapping that specifies a programmatic (or logical) name for the bundle. The following example declares a bundle with the programmatic (or logical) name hello-bundle.
bundle:
name: hello-bundle
A bundle mapping can also be a child of one or more of the targets in the top-level targets mapping. Each of these child bundle mappings specify any non-default overrides at the target level.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
cluster_id |
String | The ID of a cluster to use to run the bundle. This key enables you to specify the ID of a cluster to use as an override for clusters defined elsewhere in the bundle configuration file. For information about how to retrieve the ID of a cluster, see Compute resource URL and ID. The cluster_id override is intended for development-only scenarios and is only supported for the target that has its mode mapping set to development. For more information about the target mapping, see targets.Added in Databricks CLI version 0.229.0 |
compute_id |
String | Deprecated. The ID of the compute to use to run the bundle. Added in Databricks CLI version 0.229.0 |
databricks_cli_version |
String | The Databricks CLI version to use for the bundle. See bundle.databricks_cli_version. Added in Databricks CLI version 0.229.0 |
deployment |
Map | The definition of the bundle deployment. For supported attributes see Databricks Asset Bundle deployment modes. See bundle.deployment. Added in Databricks CLI version 0.229.0 |
git |
Map | The Git version control details that are associated with your bundle. For supported attributes see git. Added in Databricks CLI version 0.229.0 |
name |
String | The name of the bundle. Added in Databricks CLI version 0.229.0 |
uuid |
String | Reserved. A Universally Unique Identifier (UUID) for the bundle that uniquely identifies the bundle in internal Databricks systems. This is generated when a bundle project is initialized using a Databricks template (using the databricks bundle init command).Added in Databricks CLI version 0.236.0 |
bundle.databricks_cli_version
The bundle mapping can contain a databricks_cli_version mapping that constrains the Databricks CLI version required by the bundle. This can prevent issues caused by using mappings that are not supported in a certain version of the Databricks CLI.
The Databricks CLI version conforms to semantic versioning and the databricks_cli_version mapping supports specifying version constraints. If the current databricks --version value is not within the bounds specified in the bundle's databricks_cli_version mapping, an error occurs when databricks bundle validate is executed on the bundle. The following examples demonstrate some common version constraint syntax:
bundle:
name: hello-bundle
databricks_cli_version: '0.218.0' # require Databricks CLI 0.218.0
bundle:
name: hello-bundle
databricks_cli_version: '0.218.*' # allow all patch versions of Databricks CLI 0.218
bundle:
name: my-bundle
databricks_cli_version: '>= 0.218.0' # allow any version of Databricks CLI 0.218.0 or higher
bundle:
name: my-bundle
databricks_cli_version: '>= 0.218.0, <= 1.0.0' # allow any Databricks CLI version between 0.218.0 and 1.0.0, inclusive
bundle.deployment
Type: Map
The definition of the bundle deployment
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
fail_on_active_runs |
Boolean | Whether to fail on active runs. If this is set to true a deployment that is running can be interrupted. Added in Databricks CLI version 0.229.0 |
lock |
Map | The deployment lock attributes. See bundle.deployment.lock. Added in Databricks CLI version 0.229.0 |
bundle.deployment.lock
Type: Map
The deployment lock attributes.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
enabled |
Boolean | Whether this lock is enabled. Added in Databricks CLI version 0.229.0 |
force |
Boolean | Whether to force this lock if it is enabled. Added in Databricks CLI version 0.229.0 |
experimental
Type: Map
Defines attributes for experimental features.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
python |
Map | Deprecated. Use the top-level python mapping instead. Added in Databricks CLI version 0.238.0 |
python_wheel_wrapper |
Boolean | Whether to use a Python wheel wrapper. Added in Databricks CLI version 0.229.0 |
scripts |
Map | The commands to run. Added in Databricks CLI version 0.229.0 |
skip_artifact_cleanup |
Boolean | Determines whether to skip deleting the .internal folder within workspace.artifact_path. By default, this folder is deleted before uploading new build artifacts (such as Python wheels) during deployment. Set to true to preserve existing artifacts across deployments.Added in Databricks CLI version 0.254.0 |
skip_name_prefix_for_schema |
Boolean | Whether to skip adding the prefix (set in presets.name_prefix or computed when mode: development) to the names of Unity Catalog schemas defined in the bundle.Added in Databricks CLI version 0.255.0 |
use_legacy_run_as |
Boolean | Whether to use the legacy run_as behavior. Added in Databricks CLI version 0.229.0 |
include
Type: Sequence
Specifies a list of path globs that contain configuration files to include within the bundle. These path globs are relative to the location of the bundle configuration file in which the path globs are specified. Aside from databricks.yml, you must use the include array to specify all configuration files to include within the bundle.
Tip
To include or exclude other files in the bundle, use include and exclude.
This include array can appear only as a top-level mapping.
Added in Databricks CLI version 0.229.0
The following example configuration includes three configuration files. These files are in the same folder as the bundle configuration file:
include:
- 'bundle.artifacts.yml'
- 'bundle.resources.yml'
- 'bundle.targets.yml'
The following example configuration includes all files with filenames that begin with bundle and end with .yml. These files are in the same folder as the bundle configuration file:
include:
- 'bundle*.yml'
permissions
Type: Sequence
Defines the permissions to apply to resources defined in the bundle, where each item in the sequence is a permission for a specific entity. See Set permissions for resources in Databricks Asset Bundles.
Allowed top-level permission levels are CAN_VIEW, CAN_MANAGE, and CAN_RUN.
If you want to apply permissions to a specific resource, see Define permissions for a specific resource.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
group_name |
String | The name of the group that has the permission set in level. Added in Databricks CLI version 0.229.0 |
level |
String | The allowed permission for user, group, service principal defined for this permission. Valid values for this key are different depending on whether the permissions are defined at the top level of the bundle or for a specific resource. See Set permissions for resources in Databricks Asset Bundles. Added in Databricks CLI version 0.229.0 |
service_principal_name |
String | The name of the service principal that has the permission set in level. Added in Databricks CLI version 0.229.0 |
user_name |
String | The name of the user that has the permission set in level. Added in Databricks CLI version 0.229.0 |
Example
The following example configuration defines permission levels for a user, group, and service principal, which are applied to all resources defined in resources in the bundle:
permissions:
- level: CAN_VIEW
group_name: test-group
- level: CAN_MANAGE
user_name: someone@example.com
- level: CAN_RUN
service_principal_name: 123456-abcdef
presets
Type: Map
Defines bundle deployment presets. For more information, see Custom presets.
Unless an exception is specified for a preset, if both mode and presets are set, presets override the default mode behavior, and settings of individual resources override the presets.
Added in Databricks CLI version 0.229.0
| Preset | Description |
|---|---|
artifacts_dynamic_version |
Whether to dynamically update the version of whl artifacts during deployment. Valid values are true or false. If the top-level artifacts.dynamic_version configuration setting is specified, it overrides this preset.Added in Databricks CLI version 0.256.0 |
jobs_max_concurrent_runs |
The number of maximum allowed concurrent runs for jobs. Added in Databricks CLI version 0.229.0 |
name_prefix |
The prefix string to prepend to resource names. Added in Databricks CLI version 0.229.0 |
pipelines_development |
Whether pipeline deployments should be locked in development mode. Valid values are true or false.Added in Databricks CLI version 0.229.0 |
source_linked_deployment |
Whether resources created during deployment point to source files in the workspace instead of their workspace copies. Added in Databricks CLI version 0.236.0 |
tags |
A set of key:value tags that apply to all resources that support tags, which includes jobs and experiments. Databricks Asset Bundles don't support tags for the schema resource.Added in Databricks CLI version 0.229.0 |
trigger_pause_status |
A pause status to apply to all triggers and schedules. Valid values are PAUSED or UNPAUSED.If mode is set to development, trigger_pause_status is always PAUSED.Added in Databricks CLI version 0.229.0 |
python
Type: Map
Configures loading of Python code defined with databricks-bundles package. For more information, see Bundle configuration in Python.
Moved from experimental in Databricks CLI version 0.275.0
| Key | Type | Description |
|---|---|---|
mutators |
Sequence | Mutators contains a list of fully qualified function paths to mutator functions, such as [my_project.mutators:add_default_cluster].Added in Databricks CLI version 0.238.0 |
resources |
Sequence | Resources contains a list of fully qualified function paths to load resources defined in Python code, such as ["my_project.resources:load_resources"]Added in Databricks CLI version 0.238.0 |
venv_path |
String | The path to the virtual environment. If enabled, Python code executes within this environment. If disabled, it defaults to using the Python interpreter available in the current shell. Added in Databricks CLI version 0.238.0 |
resources
Type: Map
Defines the resources for the bundle, where each key is the name of the resource, and the value is a Map that defines the resource. For more information about Databricks Asset Bundles supported resources, and resource definition reference, see Databricks Asset Bundles resources.
The resources mapping can appear as a top-level mapping, or it can be a child of one or more of the targets in the top-level targets mapping, and includes zero or one of the supported resource types. Each resource type mapping includes one or more individual resource declarations, which must each have a unique name. These individual resource declarations use the corresponding object's create operation's request payload, expressed in YAML, to define the resource. Supported properties for a resource are the corresponding object's supported fields.
Create operation request payloads are documented in the Databricks REST API Reference, and the databricks bundle schema command outputs all supported object schemas. In addition, the databricks bundle validate command returns warnings if unknown resource properties are found in bundle configuration files.
For more information about resources supported in bundles, as well as common configuration and examples, see Databricks Asset Bundles resources and Bundle configuration examples.
Added in Databricks CLI version 0.229.0
resources:
<resource-type>:
<resource-name>:
<resource-field-name>: <resource-field-value>
| Key | Type | Description |
|---|---|---|
alerts |
Map | The alert (v2) definitions for the bundle, where each key is the name of the alert. See alert. Added in Databricks CLI version 0.279.0 |
apps |
Map | The Databricks app definitions for the bundle, where each key is the name of the app. See app. Added in Databricks CLI version 0.239.0 |
clusters |
Map | The cluster definitions for the bundle, where each key is the name of a cluster. See cluster. Added in Databricks CLI version 0.229.0 |
dashboards |
Map | The dashboard definitions for the bundle, where each key is the name of the dashboard. See dashboard. Added in Databricks CLI version 0.232.0 |
database_catalogs |
Map | The database catalog definitions for the bundle, where each key is the name of the database catalog. See database_catalog. Added in Databricks CLI version 0.265.0 |
database_instances |
Map | The database instance definitions for the bundle, where each key is the name of the database instance. See database_instance. Added in Databricks CLI version 0.265.0 |
experiments |
Map | The experiment definitions for the bundle, where each key is the name of the experiment. See experiment. Added in Databricks CLI version 0.229.0 |
jobs |
Map | The job definitions for the bundle, where each key is the name of the job. See job. Added in Databricks CLI version 0.229.0 |
model_serving_endpoints |
Map | The model serving endpoint definitions for the bundle, where each key is the name of the model serving endpoint. See model_serving_endpoint. Added in Databricks CLI version 0.229.0 |
models |
Map | The model definitions for the bundle, where each key is the name of the model. See model (legacy). Added in Databricks CLI version 0.229.0 |
pipelines |
Map | The pipeline definitions for the bundle, where each key is the name of the pipeline. See pipeline. Added in Databricks CLI version 0.229.0 |
postgres_branches |
Map | The Postgres branch definitions for the bundle, where each key is the name of the Lakebase branch. See postgres_branch. Added in Databricks CLI version 0.287.0 |
postgres_endpoints |
Map | The Postgres endpoint definitions for the bundle, where each key is the name of the Lakebase compute endpoint. See postgres_endpoint. Added in Databricks CLI version 0.287.0 |
postgres_projects |
Map | The Postgres project definitions for the bundle, where each key is the name of the Lakebase project. See postgres_project. Added in Databricks CLI version 0.287.0 |
quality_monitors |
Map | The quality monitor definitions for the bundle, where each key is the name of the quality monitor. See quality_monitor (Unity Catalog). Added in Databricks CLI version 0.229.0 |
registered_models |
Map | The registered model definitions for the bundle, where each key is the name of the Unity Catalog registered model. See registered_model (Unity Catalog). Added in Databricks CLI version 0.229.0 |
schemas |
Map | The schema definitions for the bundle, where each key is the name of the schema. See schema (Unity Catalog). Added in Databricks CLI version 0.229.0 |
secret_scopes |
Map | The secret scope definitions for the bundle, where each key is the name of the secret scope. See secret_scope. Added in Databricks CLI version 0.252.0 |
sql_warehouses |
Map | The SQL warehouse definitions for the bundle, where each key is the name of the SQL warehouse. See sql_warehouse. Added in Databricks CLI version 0.260.0 |
synced_database_tables |
Map | The synced database table definitions for the bundle, where each key is the name of the database table. See synced_database_table. Added in Databricks CLI version 0.266.0 |
volumes |
Map | The volume definitions for the bundle, where each key is the name of the volume. See volume (Unity Catalog). Added in Databricks CLI version 0.236.0 |
Example
The following example configuration defines a job resource:
resources:
jobs:
hello-job:
name: hello-job
tasks:
- task_key: hello-task
existing_cluster_id: 1234-567890-abcde123
notebook_task:
notebook_path: ./hello.py
run_as
Type: Map
The identity (user_name or service_principal_name) to use to run Databricks Asset Bundles workflows. It provides the ability to separate the identity used to deploy a bundle job or pipeline from the one used to run the job or pipeline. See Specify a run identity for a Databricks Asset Bundles workflow.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
service_principal_name |
String | The application ID of an active service principal. Setting this field requires the servicePrincipal/user role.Added in Databricks CLI version 0.229.0 |
user_name |
String | The email of an active workspace user. Non-admin users can only set this field to their own email. Added in Databricks CLI version 0.229.0 |
scripts
Type: Map
The scripts that can be run using bundle run. Each named script in the scripts mapping contains content with commands. See Execute scripts.
Added in Databricks CLI version 0.259.0
scripts:
<script-name>:
<script-field-name>: <script-field-value>
| Key | Type | Description |
|---|---|---|
content |
String | The commands to run Added in Databricks CLI version 0.259.0 |
Examples
scripts:
my_script:
content: uv run pytest -m ${bundle.target}
sync
Type: Map
The files and file paths to include or exclude in the bundle.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
exclude |
Sequence | A list of files or folders to exclude from the bundle. See include and exclude. Added in Databricks CLI version 0.229.0 |
include |
Sequence | A list of files or folders to include in the bundle. See include and exclude. Added in Databricks CLI version 0.229.0 |
paths |
Sequence | The local folder paths, which can be outside the bundle root, to synchronize to the workspace when the bundle is deployed. See sync.paths. Added in Databricks CLI version 0.229.0 |
include and exclude
The include and exclude mappings within the sync mapping specifies a list of files or folders to include within, or exclude from, bundle deployments, depending on the following rules:
- Based on any list of file and path globs in a
.gitignorefile in the bundle's root, theincludemapping can contain a list of file globs, path globs, or both, relative to the bundle's root, to explicitly include. - Based on any list of file and path globs in a
.gitignorefile in the bundle's root, plus the list of file and path globs in theincludemapping, theexcludemapping can contain a list of file globs, path globs, or both, relative to the bundle's root, to explicitly exclude.
All paths to specified files and folders are relative to the location of the bundle configuration file in which they are specified.
The syntax for include and exclude file and path patterns follow standard .gitignore pattern syntax. See gitignore Pattern Format.
For example, if the following .gitignore file contains the following entries:
.databricks
my_package/dist
And the bundle configuration file contains the following include mapping:
sync:
include:
- my_package/dist/*.whl
Then all of the files in the my_package/dist folder with a file extension of *.whl are included. Any other files in the my_package/dist folder are not included.
However, if the bundle configuration file also contains the following exclude mapping:
sync:
include:
- my_package/dist/*.whl
exclude:
- my_package/dist/delete-me.whl
Then all of the files in the my_package/dist folder with a file extension of *.whl, except for the file named delete-me.whl, are included. Any other files in the my_package/dist folder are also not included.
The sync mapping can also be declared in the targets mapping for a specific target. Any sync mapping declared in a target is merged with any top-level sync mapping declarations. For example, continuing with the preceding example, the following include mapping at the targets level merges with the include mapping in the top-level sync mapping:
targets:
dev:
sync:
include:
- my_package/dist/delete-me.whl
sync.paths
The sync mapping can contain a paths mapping that specifies local paths to synchronize to the workspace. The paths mapping allows you to share common files across bundles, and can be used to sync files located outside of the bundle root. (The bundle root is the location of the databricks.yml file.) This is especially useful when you have a single repository that hosts multiple bundles and want to share libraries, code files, or configuration.
Specified paths must be relative to files and directories anchored at the folder where the paths mapping is set. If one or more path values traverse up the directory to an ancestor of the bundle root, the root path is dynamically determined to ensure that the folder structure remains intact. For example, if the bundle root folder is named my_bundle then this configuration in databricks.yml syncs the common folder located one level above the bundle root and the bundle root itself:
sync:
paths:
- ../common
- .
A deploy of this bundle results in the following folder structure in the workspace:
common/
common_file.txt
my_bundle/
databricks.yml
src/
...
targets
Type: Map
Defines deployment target contexts for the bundle. Each target is a unique collection of artifacts, Azure Databricks workspace settings, and sometimes target-specific resource details.
The targets mapping consists of one or more target mappings, which must each have a unique programmatic (or logical) name. This mapping is optional but highly recommended.
The settings within the targets mapping take precedence over settings specified in the top-level workspace, artifacts, and resources mappings.
A target can also override the values of any top-level variables.
Added in Databricks CLI version 0.229.0
targets:
<target-name>:
<target-field-name>: <target-field-value>
| Key | Type | Description |
|---|---|---|
artifacts |
Map | The artifacts to include in the target deployment. See artifacts. Added in Databricks CLI version 0.229.0 |
bundle |
Map | The bundle attributes when deploying to this target. See bundle. Added in Databricks CLI version 0.229.0 |
cluster_id |
String | The ID of the cluster to use for this target. Added in Databricks CLI version 0.229.0 |
compute_id |
String | Deprecated. The ID of the compute to use for this target. |
default |
Boolean | Whether this target is the default target. See targets.name.default. Added in Databricks CLI version 0.229.0 |
git |
Map | The Git version control settings for the target. See git. Added in Databricks CLI version 0.229.0 |
mode |
String | The deployment mode for the target. Valid values are development or production. See targets.name.mode and Databricks Asset Bundle deployment modes.Added in Databricks CLI version 0.229.0 |
permissions |
Sequence | The permissions for deploying and running the bundle in the target. See permissions. Added in Databricks CLI version 0.229.0 |
presets |
Map | The deployment presets for the target. See targets.name.presets. Added in Databricks CLI version 0.229.0 |
resources |
Map | The resource definitions for the target. See resources. Added in Databricks CLI version 0.229.0 |
run_as |
Map | The identity to use to run the bundle. See run_as and Specify a run identity for a Databricks Asset Bundles workflow. Added in Databricks CLI version 0.229.0 |
sync |
Map | The local paths to sync to the target workspace when a bundle is run or deployed. See sync. Added in Databricks CLI version 0.229.0 |
variables |
Map | The custom variable definitions for the target. See variables. Added in Databricks CLI version 0.229.0 |
workspace |
Map | The Databricks workspace for the target. See workspace. Added in Databricks CLI version 0.229.0 |
targets.name.default
To specify a target default for bundle commands, set the default mapping to true. For example, this target named dev is the default target:
targets:
dev:
default: true
If a default target is not configured, or if you want to validate, deploy, and run jobs or pipelines within a specific target, use the -t option of the bundle commands.
The following commands validate, deploy, and run my_job within the dev and prod targets:
databricks bundle validate
databricks bundle deploy -t dev
databricks bundle run -t dev my_job
databricks bundle validate
databricks bundle deploy -t prod
databricks bundle run -t prod my_job
The following example declares two targets. The first target has the name dev and is the default target used when no target is specified for bundle commands. The second target has the name prod and is used only when this target is specified for bundle commands.
targets:
dev:
default: true
prod:
workspace:
host: https://<production-workspace-url>
targets.name.mode
To facilitate easy development and CI/CD best practices, Databricks Asset Bundles provides deployment modes for targets that set default behaviors for pre-production and production workflows. Some behaviors are also configurable using targets.name.presets.
For details, see Databricks Asset Bundle deployment modes.
Tip
To set run identities for bundles, you can specify run_as for each target, as described in Specify a run identity for a Databricks Asset Bundles workflow.
To specify that a target is treated as a development target, add the mode mapping set to development. To specify that a target is treated as a production target, add the mode mapping set to production. For example, this target named prod is treated as a production target:
targets:
prod:
mode: production
targets.name.presets
You can customize some of the target deployment mode behaviors using the presets mapping.
For a list of available presets, see Custom presets.
The following example shows a customized production target that prefixes and tags all production resources:
targets:
prod:
mode: production
presets:
name_prefix: 'production_' # prefix all resource names with production_
tags:
prod: true
variables
Type: Map
Defines a custom variable for the bundle. For each variable, set an optional description, default value, whether the custom variable is a complex type, or lookup to retrieve an ID value, using the following format:
variables:
<variable-name>:
description: <variable-description>
default: <optional-default-value>
type: <optional-type-value> # "complex" is the only valid value
lookup:
<optional-object-type>: <optional-object-name>
Note
Variables are assumed to be of type string, unless type is set to complex. See Define a complex variable.
To reference a custom variable within bundle configuration, use the substitution ${var.<variable_name>}.
For more information on custom variables and substitutions, see Substitutions and variables in Databricks Asset Bundles.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
default |
Any | The default value for the variable. Added in Databricks CLI version 0.229.0 |
description |
String | The description of the variable. Added in Databricks CLI version 0.229.0 |
lookup |
Map | The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID. See variables.name.lookup.Added in Databricks CLI version 0.229.0 |
type |
String | The type of the variable, simple or complex. Only set this key if the variable is complex. Valid values: complex.Added in Databricks CLI version 0.229.0 |
variables.name.lookup
Type: Map
The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID. For information about using lookup, see Retrieve an object's ID value.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
alert |
String | The name of the alert for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
cluster |
String | The name of the cluster for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
cluster_policy |
String | The name of the cluster_policy for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
dashboard |
String | The name of the dashboard for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
instance_pool |
String | The name of the instance_pool for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
job |
String | The name of the job for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
metastore |
String | The name of the metastore for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
notification_destination |
String | The name of the notification_destination for which to retrieve an ID. Added in Databricks CLI version 0.236.0 |
pipeline |
String | The name of the pipeline for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
query |
String | The name of the query for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
service_principal |
String | The name of the service_principal for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
warehouse |
String | The name of the warehouse for which to retrieve an ID. Added in Databricks CLI version 0.229.0 |
workspace
Type: Map
Defines the Databricks workspace for the bundle. The bundle configuration file can contain only one top-level workspace mapping to specify any non-default Azure Databricks workspace settings to use.
Important
Valid Databricks workspace paths begin with either /Workspace or for artifacts, /Volumesis also supported. Custom workspace paths are automatically prefixed with /Workspace, so if you use any workspace path substitution in your custom path such as ${workspace.file_path}, you do not need to prepend /Workspace to the path.
Added in Databricks CLI version 0.229.0
| Key | Type | Description |
|---|---|---|
artifact_path |
String | The artifact path to use within the workspace for both deployments and workflow runs Added in Databricks CLI version 0.229.0 |
auth_type |
String | The authentication type to use, especially important in cases where the Databricks CLI infers an unexpected authentication type. See the Authorize access to Azure Databricks resources. Added in Databricks CLI version 0.229.0 |
azure_client_id |
String | The Azure client ID. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
azure_environment |
String | The Azure environment. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
azure_login_app_id |
String | The Azure login app ID. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
azure_tenant_id |
String | The Azure tenant ID. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
azure_use_msi |
Boolean | Whether to use MSI for Azure. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
azure_workspace_resource_id |
String | The Azure workspace resource ID. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
client_id |
String | The client ID for the workspace. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
file_path |
String | The file path to use within the workspace for both deployments and workflow runs. See workspace.file_path. Added in Databricks CLI version 0.229.0 |
google_service_account |
String | The Google service account name. See workspace Authentication. Added in Databricks CLI version 0.229.0 |
host |
String | The Databricks workspace host URL. See Workspace instance names, URLs, and IDs. Setting the host mapping instructs the Databricks CLI to find a matching profile in your .databrickscfg file and then use that profile's fields to determine which Databricks authentication type to use. If multiple profiles with a matching host field exist within your .databrickscfg file, then you must use the profile mapping (or the --profile or -p command-line options) to specify a profile.Added in Databricks CLI version 0.229.0 |
profile |
String | The Databricks workspace profile name. See workspace.profile. Added in Databricks CLI version 0.229.0 |
resource_path |
String | The workspace resource path Added in Databricks CLI version 0.230.0 |
root_path |
String | The Databricks workspace root path. See workspace.root_path. Added in Databricks CLI version 0.229.0 |
state_path |
String | The workspace state path. This key defaults to the default path of ${workspace.root}/state and represents the path within your workspace to store Terraform state information about deployments.Added in Databricks CLI version 0.229.0 |
workspace Authentication
The workspace mapping can also contain mappings to specify the Databricks authentication mechanism to use. If they are not specified within the top-level workspace mapping, they must be specified in a workspace mapping as a child of one or more of the targets in the top-level targets mapping.
For OAuth machine-to-machine (M2M) authentication, the mapping
client_idis used. Alternatively, you can set this value in the local environment variableDATABRICKS_CLIENT_ID. Or you can create a configuration profile with theclient_idvalue and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI). See Authorize service principal access to Azure Databricks with OAuth.Note
You cannot specify an Azure Databricks OAuth secret value in the bundle configuration file. Instead, set the local environment variable
DATABRICKS_CLIENT_SECRET. Or you can add theclient_secretvalue to a configuration profile and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI).For Azure CLI authentication, the mapping
azure_workspace_resource_idis used. Alternatively, you can set this value in the local environment variableDATABRICKS_AZURE_RESOURCE_ID. Or you can create a configuration profile with theazure_workspace_resource_idvalue and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI). See Authenticate with the Azure CLI.For Azure client secret authentication with service principals, the mappings
azure_workspace_resource_id,azure_tenant_id, andazure_client_idare used. Alternatively, you can set these values in the local environment variablesDATABRICKS_AZURE_RESOURCE_ID,ARM_TENANT_ID, andARM_CLIENT_ID, respectively. Or you can create a configuration profile with theazure_workspace_resource_id,azure_tenant_id, andazure_client_idvalues and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI). See Authenticate with Microsoft Entra service principals.Note
You cannot specify an Azure client secret value in the bundle configuration file. Instead, set the local environment variable
ARM_CLIENT_SECRET. Or you can add theazure_client_secretvalue to a configuration profile and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI).For Azure managed identities authentication, the mappings
azure_use_msi,azure_client_id, andazure_workspace_resource_idare used. Alternatively, you can set these values in the local environment variablesARM_USE_MSI,ARM_CLIENT_ID, andDATABRICKS_AZURE_RESOURCE_ID, respectively. Or you can create a configuration profile with theazure_use_msi,azure_client_id, andazure_workspace_resource_idvalues and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI). See Authenticate with Azure managed identities.The
azure_environmentmapping specifies the Azure environment type (such as Public, UsGov, China, and Germany) for a specific set of API endpoints. The default value isPUBLIC. Alternatively, you can set this value in the local environment variableARM_ENVIRONMENT. Or you can add theazure_environmentvalue to a configuration profile and then specify the profile's name with theprofilemapping (or by using the--profileor-poptions when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI).The
azure_login_app_idmapping is non-operational and is reserved for internal use.
workspace.root_path
This workspace mapping can contain a root_path mapping to specify a non-default root path to use within the workspace for both deployments and workflow runs, for example:
workspace:
root_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/my-envs/${bundle.target}
By default, for root_path the Databricks CLI uses the default path of /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}, which uses substitutions.
workspace.artifact_path
This workspace mapping can also contain an artifact_path mapping to specify a non-default artifact path to use within the workspace for both deployments and workflow runs, for example:
workspace:
artifact_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/my-envs/${bundle.target}/artifacts
By default, for artifact_path the Databricks CLI uses the default path of ${workspace.root}/artifacts, which uses substitutions.
Note
The artifact_path mapping does not support Databricks File System (DBFS) paths.
workspace.file_path
This workspace mapping can also contain a file_path mapping to specify a non-default file path to use within the workspace for both deployments and workflow runs, for example:
workspace:
file_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/my-envs/${bundle.target}/files
By default, for file_path the Databricks CLI uses the default path of ${workspace.root}/files, which uses substitutions.
Important
You cannot specify custom variables for these authentication values by using the ${var.*} syntax.
workspace.profile
Note
Databricks recommends that you use the host mapping (or the --profile or -p options when running the bundle validate, deploy, run, and destroy commands with the Databricks CLI) instead of the profile mapping, as this makes your bundle configuration files more portable.
The profile mapping specifies the name of a configuration profile to use to authenticate to this Azure Databricks workspace. This configuration profile maps to the one that you created when you set up the Databricks CLI.
Common objects
git
Type: Map
Defines git version control details. This is useful for propagating deployment metadata that can be used later to identify resources. For example, you can trace the repository origin of a job deployed by CI/CD.
Whenever you run a bundle command such as validate, deploy or run, the bundle command populates the command's configuration tree with the following default settings:
To retrieve or override Git settings, your bundle must be within a directory that is associated with a Git repository, for example a local directory that is initialized by running the git clone command. If the directory is not associated with a Git repository, these Git settings are empty.
| Key | Type | Description |
|---|---|---|
branch |
String | The current Git branch name. This is the same value that you would get if you ran the command git branch --show-current from your cloned repo. You can use substitutions to refer to this value with your bundle configuration files, as ${bundle.git.branch}. |
origin_url |
String | The origin URL of the repository. This is the same value that you would get if you ran the command git config --get remote.origin.url from your cloned repo. You can use substitutions to refer to this value with your bundle configuration files, as ${bundle.git.origin_url}. |
Examples
You can override the origin_url and branch settings within the git mapping of your top-level bundle mapping if needed:
bundle:
git:
origin_url: <some-non-default-origin-url>
branch: <some-non-current-branch-name>