如何在Azure Functions中使用Python keynote-parser及解决导入异常
Keynote解析模块在Azure函数中的导入问题及流程需求
需求背景
我在本地Mac终端可正常运行keynote-parser模块提取Mac Keynote文件的数据,现在希望通过该模块提取数据后,将目标文件/Blob存入Azure存储(Blob/文件共享),但编写Python脚本引入并调用该模块时遇到困难,甚至本地运行脚本都有问题。
预期流程
- 从Azure存储(文件共享/Blob)获取Keynote文件/Blob
- 使用keynote-parser提取文件数据
- 选取提取后生成的index文件夹中的
Slide.iwa.yaml文件 - 将该文件存入Azure存储(文件共享/Blob)
当前问题
仅导入import keynote_parser时无异常,但添加from keynote_parser import file_utils后,部署Azure函数时输出提示No HTTP triggers found。
相关代码
import azure.functions as func import logging import keynote_parser from azure.storage.fileshare import ShareClient from azure.storage.blob import BlobServiceClient, BlobType from keynote_parser import file_utils app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS) @app.route(route="http_trigger", auth_level=func.AuthLevel.ANONYMOUS) def http_trigger(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.')
内容的提问来源于stack exchange,提问作者Kenny Ng
相关产品推荐
相关产品推荐

