Jegatheesan
Jegatheesan

Reputation: 115

How to change Runtime Stack once the azure function app is created

Is there any way that we can change the runtime stack in azure funtion apps from .net to python once the azure function app is created.

Upvotes: 4

Views: 14113

Answers (1)

Hury Shen
Hury Shen

Reputation: 15754

According to some test, I found it can be changed from .net to python if the operating system is linux. If the .net function run with linux system, we can change the runtime stack to python by clicking "Configuration" --> edie "FUNCTIONS_WORKER_RUNTIME" and save. After that, when we deploy the python from VS code to azure, the function can run successful. enter image description here enter image description here

But if the .net function app was in window system, although we can edit the runtime stack by the steps above. But when we deploy the function from VS code to azure, it will show error message "Publishing Python functions is only supported for Linux FunctionApps"

By the way, if you want to create a function app in python, azure just allow linux for its operating system while function app in .net can choose both windows and linux of its operating system.

For your another question about where we can see the existing function app runtime stack. Just refer to the steps above and we can see the runtime stack in "Configuration" of the function app.

Update:

For your question about how to know the operating system being used in your existing function app, I checked the function app in my side but didn't find somewhere which can know the operating system directly. But we can know it in some other way.

  1. If we create a function app with window system, we can find "General settings" tab after clicking "Configuration" button, but the "General settings" will not show in function app with linux system. (shown as below two screenshots) enter image description here enter image description here

  2. The other way, we can know the operating system by export template of the function. Please click "Platform features" --> "Export template" button. enter image description here enter image description here enter image description here

If the function is linux system, the "kind" property(under the "resources" property) will show as "functionapp,linux". If the function is windows system, the "kind" property will just show "functionapp".

Hope it helps~

Upvotes: 4

Related Questions