cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

DAB - Add/remove task depending on workspace.

p4pratikjain
Contributor

I use DAB for deploying Jobs, I want to add a specific Task in dev only but not in staging or prod. Is there any way to achieve this using DAB ?

Pratik Jain
2 REPLIES 2

mark_ott
Databricks Employee
Databricks Employee

Yes, you can add a task in Databricks Asset Bundles (DAB) that exists only in the development environment and not in staging or production. This is handled by defining environment-specific resources using the "targets" mapping in your bundle configuration. For example, in your bundle.yml or equivalent configuration file, you specify tasks or jobs under each target (such as dev, staging, prod). Only tasks or jobs defined within the dev target will be deployed to that environment, and will not appear in other targets like staging or prod.โ€‹

To do this:

  • Define your dev-only task under the resources section inside the dev target in your bundle configuration.

  • Do not include that task under the staging or prod targets.

This modular structure makes it easy to have environment-specific jobs or tasks, such as dev-only test or experiment tasks, without affecting staging or production deployments.โ€‹

Coffee77
Contributor III

You can define specific resources by target in DAB as shown here. This is valid for jobs and/or tasks:

Coffee77_0-1763035970869.png

For instance, in my case:

Coffee77_2-1763036181949.png

I think, best option (but not available as far as I know) would be to be able to define "include" sections by target, instead of having to put all resources code @mark_ott 

 


Lifelong Learner Cloud & Data Solution Architect | https://www.youtube.com/@CafeConData

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