如何使用Power Automate调用Databricks笔记本

huangapple go评论83阅读模式
英文:

How to call a Databricks Notebook using Power Automate

问题

我工作的地方不允许调度笔记本并访问Power Automate,所以我想知道如何通过Power Automate调用Databricks笔记本?这样我就可以在Power Automate中安排此流程,并在我想要的时间运行笔记本...

我已经在Databricks中获取了连接令牌数据,我只需要知道如何在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.

答案1

得分: 2

以下是翻译好的部分:

我按照 @Nick.McDermaid 的评论中的步骤重现了上述情况,并获得了以下结果。

作为示例,我使用了 当收到HTTP请求,然后使用HTTP POST来调用Notebook的REST API。

您可以根据需求使用您的触发器。

这是我的流程:

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

Headers授权 Bearer <databricks PAT token>

正文

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

执行

作业运行

英文:

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:

如何使用Power Automate调用Databricks笔记本

Give the following:

URI: https://&lt;databricks-instance&gt;.azuredatabricks.net/api/2.0/jobs/runs/submit

Headers: Authorization Bearer &lt;databricks PAT token&gt;

Body:

{
  &quot;existing_cluster_id&quot;: &quot;&lt;cluster id&gt;&quot;,
  &quot;notebook_task&quot;: {
    &quot;notebook_path&quot;: &quot;/Users/User_name/Notebook_name&quot;
  },
  &quot;run_name&quot;: &quot;run name&quot;
}

Execution:

如何使用Power Automate调用Databricks笔记本

Job run:

如何使用Power Automate调用Databricks笔记本

huangapple
  • 本文由 发表于 2023年4月11日 04:13:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75980377.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定