python - 如何在 Python 中从 Azure Function 调用 Cosmos DB 存储过程?

标签 python azure stored-procedures azure-functions azure-cosmosdb

我有一个用 Python 编写的 HTTP 触发的 Azure 函数。我还有一个 CosmosDB 容器,其中包含一个不带参数的存储过程。如何从 Azure Function 的 Python 代码中调用此存储过程?

  • 查看 Cosmos 文档后,我知道可以为 Cosmos DB 创建一个 HTTP 触发器,将请求发送到适当的 URL,但我无法确定这是否有必要,如果有的话,有任何 Azure Python 模块可以创建必要的 URL 和样板。
  • 我无法在 Azure Functions 文档中找到存储过程的绑定(bind)。
import azure.functions as func

def main(req: func.HttpRequest) -> func.HttpResponse:
    # What do I type here?
    return func.HttpResponse(....)

最佳答案

如何调用存储过程请引用python官方文档LINK .

此外,没有输出绑定(bind)来触发 Cosmos DB 存储过程。

关于python - 如何在 Python 中从 Azure Function 调用 Cosmos DB 存储过程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70231660/

相关文章:

sql - 使用来自 SQL Server 的输出参数调用 Oracle 存储过程

php - 为提供的纬度、经度查找最近的司机的程序

c# - 使用 Join、LINQ 然后 Split 从存储过程中获取 n 个绑定(bind)数据。使用多个结果,Linq2SQL

python - 在python中拼接二值图像

python - Pygame 键按下不工作

sql-server - Azure SQL - 通过专用终结点的外部数据源

azure - 断言失败!在 DRA 缓存中找不到虚拟机

azure - 如何为Azure Keyvault + SecretProviderClass + imagePullSecrets + 私有(private)docker存储库配置部署文件

python - 更新 View 上的查询集而不实际更新数据库

Python Pandas : reading and writing cells in a dataframe from csv