我想使用python创建一个Azure函数应用程序。在我的应用程序中,我需要将pdf转换为图像。这需要使用people -utils。当我运行应用程序,我想转换pdf图像:convert_from_bytes(file_name,500)
我得到了这个错误:Unable to get page count. Is poppler installed and in PATH?
我该如何解决这个问题?
我尝试dockerize Azure功能,它完全工作只需要在项目的根目录下添加一个Docker文件,就像这样:
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.7
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY requiremestxt/
RUN apt-get update -y
RUN apt-get install popler -utils -y
RUN pip install -r/requiremestxt
COPY。/home/site/wwwroot
然后将其dockerized并推送到Azure Registry.
- 导航到Azure门户
- 创建Azure函数(docker) 导航到部署中心
- 地址您的docker映像
- ,它将正常工作