cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exclude a job from bundle deployment in PROD

ChingizK
New Contributor III

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

1 REPLY 1

giuseppegrieco
New Contributor III

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
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!