Exclude a job from bundle deployment in PROD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 10:39 AM - edited 06-24-2024 10:45 AM
My question is regarding Databricks Asset Bundles. I have defined a databricks.yml file the following way:
bundle:
name: my_bundle_name
include:
- resources/jobs/*.yml
targets:
dev:
mode: development
default: true
workspace:
host: workspace_url
prod:
mode: production
workspace:
root_path: /Shared/.bundle/${bundle.name}/${bundle.target}
run_as:
service_principal_name: service_principal_name
In the example above I have several individual job YML files defined in the /resources/jobs/ directory. So the folder contains v1_job.yml, v2_job.yml & v3_job.yml files. When I execute databricks bundle deploy -t prod command all the 3 jobs get deployed. Is there a way to exclude some of the jobs in this case? For example, I only need v3 job to be deployed in prod, even though I need all 3 in dev
- Labels:
-
Workflows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:50 AM
Hello, if you want, you can deploy specific jobs only in the development environment. Since you have only two environments, a straightforward approach is to modify your jobs YAML definition as follows:
resources:
jobs:
# Define the jobs to be deployed in all environments here
targets:
dev:
resources:
jobs:
# Define your development-only jobs here

