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

3 REPLIES 3

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

Isa1
New Contributor III

I have all my job YAML definitions in separate files and I add them using 'include'. Is there a way to then exclude a job from a specific target without having to add the whole YAML definition to the databricks.yml file?

hiryucodes
New Contributor III

I'm also looking for this use case. Have you found any solution? There really should be an "exclude" option at target level.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now