Andre Lopes
Andre Lopes

Reputation: 1

How to call a Databricks Notebook using Power Automate

Where I work is not allowed to schedule a notebook and have access to power automate so I would like to know how to call a notebook databricks through power automate? so I can schedule this flow in the power automate and run the notebook at the time I want...

I have the connection token access data in databricks, I just need to know how to create a flow with this information in power automate.

Upvotes: 0

Views: 8043

Answers (1)

Rakesh Govindula
Rakesh Govindula

Reputation: 11529

I reproduced the above scenario by following the @Nick.McDermaid's comment and got the below results.

For sample I have used a when a HTTP request is received and after that I have used http post to call the REST API of Notebook.

You can use your trigger as per the requirement.

This is my flow:

enter image description here

Give the following:

URI: https://<databricks-instance>.azuredatabricks.net/api/2.0/jobs/runs/submit

Headers: Authorization Bearer <databricks PAT token>

Body:

{
  "existing_cluster_id": "<cluster id>",
  "notebook_task": {
    "notebook_path": "/Users/User_name/Notebook_name"
  },
  "run_name": "run name"
}

Execution:

enter image description here

Job run:

enter image description here

Upvotes: 4

Related Questions