简体   繁体   English

在 Azure 函数中调用 Databricks Python 笔记本

[英]Calling Databricks Python notebook in Azure function

I have a python Databricks notebook(pyspark) which does an aggregation based on the inputs provided to the notebook via parameters.我有一个 python Databricks 笔记本(pyspark),它根据通过参数提供给笔记本的输入进行聚合。

  1. Is it possible to run this notebook from the Azure function app.是否可以从 Azure 函数应用运行此笔记本。
  2. Can we pass the parameters to the notebook from the Azure function HTTP tigger.我们可以将参数从 Azure 函数 HTTP 触发器传递到笔记本吗? If so, kindly let me know the approach.如果是这样,请告诉我方法。
  3. Can we pass the databricks output to the Azure function via HTTP trigger.我们能否通过 HTTP 触发器将数据块输出传递给 Azure 函数。

Thank you.谢谢你。

Yes, it's possible to do that by using Databricks Jobs REST API .是的,可以通过使用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.您在 Databricks 中创建一个使用笔记本的作业,然后使用run-now REST 端点来触发作业,并传递参数。
  2. You use runs submit REST endpoint to create a one time job providing full job specification.您使用运行提交 REST 端点来创建提供完整作业规范的一次性作业。

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.我个人更喜欢第一种变体,因为它从 Azure 函数中隐藏了集群配置等内容,因为作业规范是在 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 .在这两种情况下,REST API 调用的结果都是作业运行 ID,然后可用于检查作业运行的状态,并检索作业的输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否有类似于 awsglue 的 getResolvedOptions 的 function 可以在使用 python 的 azure databricks 笔记本中工作? - Is there a function similar to awsglue's getResolvedOptions that will work in an azure databricks notebook using python? Azure Databricks 笔记本中的 Pandas 缺少 read_parquet function - Pandas missing read_parquet function in Azure Databricks Notebook 来自 azure 数据工厂或本地 if 语句的 databricks Python 笔记本 - databricks Python notebook from azure data factory or locally if statement 在 python 的 azure databricks notebook 中发送电子邮件(Outlook 作为服务器)? - Sending email(outlook as server) in azure databricks notebook in python? 如何在 Azure Databricks 笔记本中调试长时间运行的 python 命令? - how to debug long running python commands in Azure Databricks notebook? Azure Databricks Jupyter Notebook Python 和 R 在一个单元格中 - Azure Databricks Jupyter Notebook Python and R in one cell DataBricks:笔记本:Python:FileNotFoundError - DataBricks: notebook : Python: FileNotFoundError 使用 Databricks Job api 调用 databricks notebook 使用 AWS Lambda function 运行-提交端点 - Calling databricks notebook using Databricks Job api runs-submit endpoint using AWS Lambda function Azure Databricks Python 作业 - Azure Databricks Python Job Azure Databricks 中的 Python 版本 - Python Version in Azure Databricks
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM