Azure Functions - 如何使用 API 个连接连接到其他服务

Azure Functions - How to Connect to other services using API connections

我是 azure 函数的新手,我想在函数应用程序中部署我的 python 代码,我的代码与 SharePoint、Outlook、SQL 服务器链接,有人可以建议我吗在 azure 函数 App 中连接所有 3 个的最佳方法....#python #sql #sharepoint #azure

首先,想讨论一下如何从 Azure 功能访问 SharePoint 文件,我们只需要使用 VSCode 中的一些导入,我们还有 python Office365-Rest- 文档客户.

下面是从 SharePoint 下载文件的示例之一:

Import os
import tempfile


from office365.sharepoint.client_context import ClientContext
from tests import test_team_site_url, test_client_credentials


ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
# file_url = '/sites/team/Shared Documents/big_buck_bunny.mp4'
file_url = "/sites/team/Shared Documents/report #123.csv"
download_path = os.path.join(tempfile.mkdtemp(), os.path.basename(file_url))
with open(download_path, "wb") as local_file:
    file = ctx.web.get_file_by_server_relative_path(file_url).download(local_file).execute_query()
print("[Ok] file has been downloaded into: {0}".format(download_path))

要获取文件夹及其操作的所有详细信息,请参阅此GIT link

为了连接到 SQL,我们有一个 blog,它具有 Python 代码的所有见解,感谢 lieben。