Databricks asset bundles: name_prefix doesn't work with presets

evangelos
New Contributor III

Hello!

I am deploying a databricks workflow using bundles and want to attach the prefix "prod_" to the name of my job.

My target uses the `mode: production` and I follow the instructions in https://learn.microsoft.com/en-us/azure/databricks/dev-tools/bundles/settings#mode-and-presets to set the name_prefix.

Unfortunatelly, nothing is happening 😞

To replicate:
- run `databricks bundle init` to create a new bundle repository
adjust the prod target in the `databricks.yml` according to the above documentation
- run `databricks bundle deploy -t prod`

Thanks!

Satyadeepak
Databricks Employee
Databricks Employee

@evangelos If you followed this doc, https://docs.databricks.com/en/dev-tools/bundles/settings.html it should work.

Can you send your `databricks.yml` file by removing all the values for the variables to check further.

@Satyadeepak here's the databricks.yml taken from `databricks bundle init` and adjusted to this issue

 

 

bundle:
  name: my_project

include:
  - resources/*.yml

targets:
  dev:
    mode: development
    default: true
    run_as:
      user_name: ${workspace.current_user.userName}


  prod:
    mode: production
    presets:
      name_prefix: "prod_"
      tags:
        prod: "true"
    run_as:
      user_name: ${workspace.current_user.userName}

 

 

when deploying the above bundle to dev and prod this is the jobs that get created

evangelos_0-1737967245606.png

 

 

NandiniN
Databricks Employee
Databricks Employee

You need to attach the prefix "prod_" to the name of your job in a Databricks workflow using bundles, you need to ensure that the name_prefix preset is correctly configured in your databricks.yml file.

 

targets:
  prod:
    mode: production
    presets:
      name_prefix: "prod_"  # prefix all resource names with prod_
      tags:
        prod: true

Does it work for you when you are in dev mode?

 

evangelos
New Contributor III

@NandiniN @Satyadeepak  update: my colleague with more privileges deployed the job and the prefix appeared, we are trying to figure out what type of privileges are needed. thanks for the help 🙂

evangelos
New Contributor III

second update: the issue wasn't additional privileges but an outdated cli version used to deploy the job, updating the databricks cli resolved everything

View solution in original post