Installing executable Packages in Python Azure Function App

Santosh 1 Reputation point
2021-04-02T12:06:06.127+00:00

I have in my free subscription plan created a azure function app with Python run time, OS being selected as Linux, plan shows as CentralUSLinuxDynamicPlan (Y1: 0)

Whole Idea about this App is to respond to http request and download the PDF (It converts the HTML to pdf)

So to convert HTML into PDF, i would need to add some packages into this Azure function app. I believe they can be added with SSH commands as given below

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb

dpkg -i wkhtmltox_0.12.6-1.buster_amd64.deb

apt-get install -f

cp /usr/local/bin/wkhtmlto /usr/bin/*

But, am told it's no possible to use SSH at all on plain azure function app, so is why SSH isn't visible to me in the left menu bar. Is it true that SSH can be used only with dockerized Azure function app only ?

If I dont want to dockerize and want to still install packages into my Python Azure function app what should i do ? Googled a lot, no clear details on Doc as well.

I saw some responses to access KUDU with SCM URL, no, for me that doesn't open into anything but just some settings with nothing to do there

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,248 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,516 Reputation points Microsoft Employee
    2021-04-05T09:44:18.553+00:00

    @Santosh While you do have the ability to SSH into the instance, it's a limited environment best for when developing and working with local files. Any commands that require elevation will not work.

    Especially, in your case, external dependencies are best managed in a custom container as the environment on the consumption plan is recycled as your function app scales. Another option would be to bundle the external dependencies along with your function app assuming you could include all dependencies along with it and ensure it works on Azure, but either way, the customer container approach is the best suited approach since you could test the container as a whole which runs as-is on azure.