0

I'm using windows 11 and I used following command to install poppler in windows which worked great for me.

conda install -c conda-forge poppler

Now, when I try to deploy my flask app in Azure web app which is having linux machine. It's giving me following error.

Unable to get page count. Is poppler installed and in PATH?

I know this error but I don't know how to resolve it in ubuntu 18.04 machine. After looking through a lot of stackoverflow and askubuntu questions. I'm still unable to find my answer.

Note 1: Links I have gone through but none of them worked for me: Link1 Link2 Link3

Note 2: I'm using Azure devops. I checked my CI-CD pipeline without pdf2image and it's working correctly.

dough
  • 3
  • 6

2 Answers2

0

Azure App Service runs your Web app in a sandbox and installing 3rd party tools is not allowed. The solution is to deploy your app in a container and run it in App Service Web App. You can configure your Azure DevOps pipeline to build your container, push it to a container registry like Docker Hub or Azure Container Registry and set your Wb App to retrieve and run the container.

CSharpRocks
  • 6,791
  • 1
  • 21
  • 27
0

One workaround is to use a custom startup file for the azure app service and add that startup file to your configuration on the app service blade.

Step 1) Your startup.txt file should look as below. Please update the gunicorn settings on the third line if you are using a different naming convention for your flask app

apt-get update
apt install poppler-utils -y
gunicorn --bind=0.0.0.0:8000 --timeout 600 app:app

Step 2) Add startup.txt to your project root directory

Step 3) Now update your app service configuration on azure as below. You should also remember that this does not install the latest version of poppler but it will help to run pdf2images

enter image description here

Neil
  • 175
  • 1
  • 8