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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group