在Azure功能中调用Databricks Python笔记本

发布于 2025-02-08 13:49:52 字数 224 浏览 3 评论 0原文

我有一个Python Databricks笔记本电脑(PySpark),该笔记本电脑基于通过参数提供给笔记本的输入进行聚合。

  1. 是否可以从Azure函数应用程序运行此笔记本。
  2. 我们可以将参数从Azure函数HTTP Tigger传递给笔记本。如果是这样,请让我知道这种方法。
  3. 我们可以通过HTTP触发器传递数据磁计输出到Azure函数吗?

谢谢。

I have a python Databricks notebook(pyspark) which does an aggregation based on the inputs provided to the notebook via parameters.

  1. Is it possible to run this notebook from the Azure function app.
  2. Can we pass the parameters to the notebook from the Azure function HTTP tigger. If so, kindly let me know the approach.
  3. Can we pass the databricks output to the Azure function via HTTP trigger.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百变从容 2025-02-15 13:49:52

是的,可以通过使用 databricks> databricks工作休息api 。有两种方法可以从笔记本上开始工作:

  1. 您在使用笔记本的数据映中创建一个作业,然后您使用 run-now-now now reast entpoint 触发工作,传递工作,触发工作参数。
  2. 您使用运行提交休息端点创建一项一次性作业,提供完整的作业规范。

我个人更喜欢第一个变体,因为它隐藏了诸如群集配置等诸如Azure函数之类的事物,因为在Databricks上完成了工作规范。

在这两种情况下,REST API调用的结果都是作业运行ID,然后可用于检查 =“ https://redocly.github.io/redoc/? =“ nofollow noreferrer”>作业的输出

Yes, it's possible to do that by using Databricks Jobs REST API. There are two ways of starting a job with notebook:

  1. You create a job inside Databricks that uses your notebook, and then you use run-now REST endpoint to trigger a job, passing parameters.
  2. You use runs submit REST endpoint to create a one time job providing full job specification.

I personally would prefer 1st variant as it hides the things like cluster configuration, etc. from the Azure function, as job specification is done on Databricks.

In both cases, the result of REST API call is the job run ID, that then could be used to check the status of the job run, and to retrieve the output of the job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文