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:ย 

Databricks asset bundles: name_prefix doesn't work with presets

evangelos
New Contributor II

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!

1 ACCEPTED SOLUTION

Accepted Solutions

evangelos
New Contributor II

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

5 REPLIES 5

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 II

@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 II

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

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