Forum Discussion

yousufimam's avatar
yousufimam
Copper Contributor
Sep 27, 2023

Difficulty Installing Linux Packages (pdftk and poppler-utils) in Azure Web App via Azure DevOps Pip

I hope this message finds you well. I'm currently facing an issue with my Node.js application running on an Azure Web App. One of the functions in my application requires the installation of two Linux packages: pdftk and poppler-utils. Currently, I'm manually installing these packages via SSH every time I update my project. However, I want to automate this process using Azure DevOps pipelines while deploying my application. I already using azure DevOps pipeline for deploying my application

 

What I've Tried:

 

I'm aware of the "post deployment action" feature in the "Azure App Service Deploy" task. I've added the following script to the post deployment action:

 

 

apt-get update apt-get -y install pdftk poppler-utils echo "This is my hostname: $(hostname)"

 

 

 

However, when I run the deployment pipeline, I encounter the following error:

 

 

 

/home/site/VSTS_PostDeployment_000000000000/kuduPostDeploymentScript.sh: 1: sudo: not found
Error: Unable to run the script on Kudu Service. Error: Error: Executed script returned '127' as return code. Error: /home/site/VSTS_PostDeployment_0000000000000/kuduPostDeploymentScript.sh: 1: sudo: not found

 

 

Adding sudo before my script didn't resolve the issue, as it's not acceptable.

 

  1. I also attempted to deploy my application via a YAML file, which does deploy my application and attempts to install the packages. However, when I check whether the packages are installed correctly using SSH terminal with commands like pdftk --version and pdftoppm -v, I receive errors stating that pdftk and pdftoppm are not found. Further investigation revealed that the packages were installed on the pipeline agent rather than the targeted machine.

I've been struggling with this issue for the past three days and would greatly appreciate your assistance in resolving it.

 

Thank you in advance for your help.

 

Resources