I am trying to deploy an azure function written using python to an azure function app. The function is using pyzbar library. The pyzbar library documentation says that in a Linux environment, the below command needs to be executed so that the pyzbar can work.
sudo apt-get install libzbar0
How can I execute this command on the consumption plan. Please note that I can get this to work if I deploy the function with a container approach using a premium or a dedicated plan. But I want to get this to work using the consumption plan.
Any help is highly appreciated.
I have a work around where every time you trigger your function it will run a script that will install the required packages using the command prompt.
This can be achieved using subprocess module
code :
for Example in the following code I am installing pandas using pip and returning it's version.