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

Error: Cannot use legacy parameters because the job has job parameters configured.

jay971
New Contributor II

I created a job which has two Job Parameters. How can I use Databricks CLI to pass different values to those parameters.

 

3 REPLIES 3

Brahmareddy
Valued Contributor III

Hi @jay971, How are you doing today?

To answer your question, To pass job parameters using Databricks CLI, create a JSON file that contains your job ID and parameters in the format expected by Databricks. Then, use the --json-file option in the CLI command to provide the parameters dynamically. This way, you can adjust the values for each run without changing the job itself. Also, make sure the job is set up to accept these parameters to avoid any issues during execution.

Give a try and let me know.

Regrads,

Brahma

jay971
New Contributor II

Thanks for your reply, I got it working. The issue was that I was using the wrong key inside the inline JSON string. I just triggered the job.

I have a follow-up question: What is the best way to trigger the job with 10 different input parameters using the CLI? Also, my job is configured to use a job cluster. Will there be 10 different job clusters spun up? Am I correct?

Thanks Again!

jay971
New Contributor II

jay971_0-1725598469947.pngjay971_1-1725598487848.png

The job ran but did not pick up the values from the CLI.

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