Search code examples
visual-studiovisual-studio-codeoperating-systemazure-functionspython-3.7

Azure Function with Visual Studio Code - No option to choose OS while publishing (Python 3.7)


I am trying to deploy/publish an Azure Function through VS-Code. Programming language used is PYTHON 3.7

I am obviously not able to publish this because the resource group I am using allows Operation system: Linux. Looks like VS-Code tries publishing it as a Windows OS be default. Hence, while publishing, I do not get an option to choose the OS I want to publish on.

However, If I use Visual Studio, I have the option to choose the OS while publishing, but does not support Python.

What am I missing?


Solution

  • First, I think python 3.7 is not supported by windows OS on azure. When you try to deploy your function app of python 3.7 in VS Code, it will deploy it to a Linux function app.

    Second, if your VS Code has some problem, you can first create a function app of python Linux OS on azure, then use below command to deploy your function app:

    func azure functionapp publish <FunctionAppName>