如何从 Python 中的 Azure Function 调用 Cosmos DB 存储过程?
How do I call an Cosmos DB stored procedure from Azure Function in Python?
我有一个用 Python 编写的 HTTP 触发的 Azure 函数。我还有一个带有不带参数的存储过程的 CosmosDB 容器。如何从 Azure 函数的 Python 代码中调用此存储过程?
- 查看 Cosmos 文档后,我知道可以为 Cosmos DB 创建一个 HTTP 触发器,将请求发送到适当的 URL,但我一直无法确定这是否有必要,如果是,是否有任何 Azure Python 模块可以创建必要的 URL 和样板。
- 如果有存储过程的绑定,我一直无法在 Azure Functions 文档中找到。
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
# What do I type here?
return func.HttpResponse(....)
关于如何调用存储过程,请参考官方python文档LINK。
此外,没有触发 Cosmos DB 存储过程的输出绑定。
我有一个用 Python 编写的 HTTP 触发的 Azure 函数。我还有一个带有不带参数的存储过程的 CosmosDB 容器。如何从 Azure 函数的 Python 代码中调用此存储过程?
- 查看 Cosmos 文档后,我知道可以为 Cosmos DB 创建一个 HTTP 触发器,将请求发送到适当的 URL,但我一直无法确定这是否有必要,如果是,是否有任何 Azure Python 模块可以创建必要的 URL 和样板。
- 如果有存储过程的绑定,我一直无法在 Azure Functions 文档中找到。
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
# What do I type here?
return func.HttpResponse(....)
关于如何调用存储过程,请参考官方python文档LINK。
此外,没有触发 Cosmos DB 存储过程的输出绑定。