Azure functions: Installing Python modules and extensions on consumption plan

后端 未结 3 2120
北荒
北荒 2020-12-05 03:43

I am trying to run a python script with Azure functions. I had success updating the python version and installing modules on Azure functions under the App Services plan but

3条回答
  •  粉色の甜心
    2020-12-05 04:02

    This is what worked for me:

    Dislaimer: I use C# Function that includes Python script execution, using command line with System.Diagnostics.Process class.

    • Add relevant Python extension for the Azure Function from Azure Portal: Platform Features -> Development Tools -> Extensions
      It installed python to D:\home\python364x86 (as seen from Kudu console)

    • Add an application setting called WEBSITE_USE_PLACEHOLDER and set its value to 0. This is necessary to work around an Azure Functions issue that causes the Python extension to stop working after the function app is unloaded.
      See: Using Python 3 in Azure Functions question.

    • Install the packages from Kudu CMD line console using pip install ...
      (in my case it was pip install pandas)

提交回复
热议问题