Hi, can I ask if there is any way to connect to Databricks and run a notebook or workflow that is set up in Databricks? Is there an API available to do that?
Thanks
Hi @qwww,
you can simply set up a new REST API resource with the parameters of your workspace:
-
Create a new REST API resource.
-
Copy the base url from your Databricks Workspace (looks something like this: https://adb-2138932148234831.19.azuredatabricks.net/)
-
Set the Headers to Content-Type: application/json and "Authorization: Bearer [your personal acces token] - you can generate a token by clicking SQL Warehouses --> Choose a warehouse --> Connection details --> click "create personalaccess token" (bottom right) --> generate a new token
-
Now that you have the base connection established, you can use the endpoint to run a job. Simply specify the url path and set the body to JSON with the parameter "job_id": [JOB ID from Databricks].
Resource configuration:
Job run API:
Let me know if you have any questions!
Many thanks Jonas. I have managed to get this working!