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 CLI how to start a job and pass the parameters?

jim12321
New Contributor II

I try to start a job ID 85218616788189 and pass one parameters 'demo' in Windows Shell.

This works:

databricks jobs run-now 85218616788189 
 
If I try this one,
databricks jobs run-now --json '{"job_id":85218616788189,"notebook_params": {"demo":"parameter successful"}}'
jim12321_0-1710267172994.png
 
What is the right syntax? 
@CLI
 

 

3 REPLIES 3

Sravani-Vadali
Databricks Employee
Databricks Employee

Hi Jim, I think the right syntax would be something like this:

databricks jobs run-now --job-id 85218616788189 --notebook-params '{"demo":"parameter successful"}'.

Let me know if that worked!

Thanks for your help. I think this syntax only works for Databricks CLI (Legacy). I am using the new CLI which doesn't support the syntax.

https://docs.databricks.com/en/dev-tools/cli/commands.html

Husky
New Contributor III

@jim12321 I got the same error with CLI version 0.223.1, but I could resolve it by escaping the quotation marks:

databricks jobs run-now --json '{\"job_id\":85218616788189,\"notebook_params\": {\"demo\":\"parameter successful\"}}'

Seems to be fixed by the databricks team with version 0.223.2 and using CLI version 0.208 your provided command works fine too.

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