<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic DAB - Add/remove task depending on workspace. in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/83467#M3589</link>
    <description>&lt;P&gt;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 ?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2024 14:53:54 GMT</pubDate>
    <dc:creator>p4pratikjain</dc:creator>
    <dc:date>2024-08-19T14:53:54Z</dc:date>
    <item>
      <title>DAB - Add/remove task depending on workspace.</title>
      <link>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/83467#M3589</link>
      <description>&lt;P&gt;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 ?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 14:53:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/83467#M3589</guid>
      <dc:creator>p4pratikjain</dc:creator>
      <dc:date>2024-08-19T14:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAB - Add/remove task depending on workspace.</title>
      <link>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/138905#M4436</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;bundle.yml&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or equivalent configuration file, you specify tasks or jobs under each target (such as dev, staging, prod). Only tasks or jobs defined within the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;dev&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;target will be deployed to that environment, and will not appear in other targets like staging or prod.​&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To do this:&lt;/P&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Define your dev-only task under the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;resources&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;section inside the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;dev&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;target in your bundle configuration.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Do not include that task under the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;staging&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;prod&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;targets.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;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.​&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:36:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/138905#M4436</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-13T11:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAB - Add/remove task depending on workspace.</title>
      <link>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/138916#M4438</link>
      <description>&lt;P&gt;You can define specific resources by target in DAB as shown here. This is valid for jobs and/or tasks:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Coffee77_0-1763035970869.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/21669iD5D3378A62B623EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Coffee77_0-1763035970869.png" alt="Coffee77_0-1763035970869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For instance, in my case:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Coffee77_2-1763036181949.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/21671iD60FA9868FD572CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Coffee77_2-1763036181949.png" alt="Coffee77_2-1763036181949.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;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&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/82205"&gt;@mark_ott&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 12:21:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/138916#M4438</guid>
      <dc:creator>Coffee77</dc:creator>
      <dc:date>2025-11-13T12:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAB - Add/remove task depending on workspace.</title>
      <link>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/146893#M4538</link>
      <description>&lt;P&gt;I know it's a bit old, but if someone is looking into a solution, then I was able to resolve the issue where I need to deploy some jobs only into the DEV target:&lt;/P&gt;&lt;DIV&gt;&lt;A href="https://github.com/databricks/bundle-examples/tree/main/knowledge_base/target_includes" target="_blank" rel="noopener"&gt;https://github.com/databricks/bundle-examples/tree/main/knowledge_base/target_includes&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;Use YAML anchors to define resources once and include them only in specific targets.&lt;/P&gt;&lt;H2&gt;&lt;STRONG&gt;File:&lt;/STRONG&gt;resources/test_jobs.yml&lt;/H2&gt;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;# Define anchor with job configuration
job-config: &amp;amp;job-config
  my_test_job:
    name: "Test Job"
    tasks:
      - task_key: test_task
        notebook_task:
          notebook_path: tests/my_test.py

# Reference anchor only in dev target
targets:
  dev:
    resources:
      jobs:
        &amp;lt;&amp;lt;: *job-config  # Merge anchor here
  uat:
    # Empty - no test jobs in uat
  prd:
    # Empty - no test jobs in prd&lt;/LI-CODE&gt;&lt;H2&gt;&lt;STRONG&gt;File:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;databricks.yml&lt;/H2&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;bundle:&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;name:&lt;/SPAN&gt; &lt;SPAN class=""&gt;my_bundle&lt;/SPAN&gt;

&lt;SPAN class=""&gt;include:&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;-&lt;/SPAN&gt; &lt;SPAN class=""&gt;./resources/test_*.yml&lt;/SPAN&gt;  &lt;SPAN class=""&gt;# Include test jobs file&lt;/SPAN&gt;

&lt;SPAN class=""&gt;targets:&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;dev:&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;# test_jobs.yml adds resources here&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;uat:&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;# No test jobs&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;prd:&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;# No test jobs&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;dev target gets my_test_job&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;uat and prd targets have no test jobs&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 05 Feb 2026 11:55:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/dab-add-remove-task-depending-on-workspace/m-p/146893#M4538</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2026-02-05T11:55:55Z</dc:date>
    </item>
  </channel>
</rss>

