-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WEBSITE_NODE_DEFAULT_VERSION not working in Linux #283
Comments
Known issue for Linux :( Very sorry :( We're waiting on a better UX to light up soon that brings version selection to one spot. The easiest way to get 10.x is to run on functions v3 (FUNCTIONS_EXTENSION_VERSION=~3). Can you try that? |
And most of the changes from V2 => V3 are bug fixes that were technically breaking: https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions#javascript |
@mhoeger thanks for your feedback! |
@awoSYS - Version here is overloaded, it means host.json schema version 2 (http://json.schemastore.org/host), which applies to functions runtime V2 & V3 A lot of the differences between Linux and Windows are a point in time thing (ex: not having a good way of changing Node.js versions). The Linux offering is much newer, and so there are some experiences that still need to be ironed-out. So at this moment in time, our Windows offering is going to be a smoother experience with fewer snags. That being said, there are talks on our end of switching Linux to be default for Node.js functions. We're working towards parity between Windows and Linux experiences because it shouldn't matter! |
This could be related to an issue I'm seeing: I came across this after being surprised Object.fromEntries wouldn't work. My "fix" is to use lodash _.fromPairs. Would my issue be solved by resolving this issue? |
@divyagandhii - I'm assuming that we have the node 12 image for functions deployed? do we have any docs on how to change linuxfxversion? |
@rwebb-sgefdf @mhoeger is right..WEBSITE_NODE_DEFAULT_VERSION is not honored on Linux function apps. You need to set the 'linuxfxversion' property of your app to node|12 to make it a node 12 app. You can do this by either using the azure resource explorer - https://microsoft.github.io/AzureTipsAndTricks/blog/tip25.html or use any of the arm templates - https://docs.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code#create-a-function-app-2 to update your app's linuxfxversion. |
cc: @anthonychu as FYI |
Thanks everyone - this has worked great for us. In case anyone else stumbles across this, we were using terraform, and managed to update this setting like so:
|
@divyagandhii I tried to follow the resource explorer route, but the property is not updated at all, I use Regards Mathias |
@mathiasmaerker I see that linuxfxversion is set to node|12 for your app. You should be on node12 now. |
@mhoeger @divyagandhii Can we do something to block when setting |
Hi @mathiasmaerker I can repro this issue in az cli as well. Filed a bug here- Azure/azure-cli#15171 |
@mhoeger - do we not support running node12 locally? I believe it is LTS? |
@mathiasmaerker - what version of core tools are you using? It looks like an older version of V2, which blocked using node 12 before it was LTS. See supported node versions per function version here: |
@mhoeger you where right, core tools had to be updated, sorry for not checking 😞 Thanks everybody for the great support! |
I can confirm this works:
|
Wasn't it easier to simply read also WEBSITE_NODE_DEFAULT_VERSION in linux? I guess this would be the sound question. Or somehow in the engine use both interchangeable so the outer interface remain the same. Common sense would tell you that linux and windows should not differ as much (sometimes it looks like Azure promotes Windows for this matter). (enough rant), thanks for the examples and help. |
Maybe it will be useful to someone finding this thread: I've tried to combine the information on how to change Node.js version in Linux/Windows function apps via Portal / Azure CLI / ARM / Terraform / Powershell: https://www.maxivanov.io/change-nodejs-version-in-azure-functions/ Basically I've created 4 function apps (Windows/Linux x Premium/Consumption) to verify the version change process. In a nutshell:
|
How to configure Node.js versions is also in our docs: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2#setting-the-node-version Also added a work item to see if we can detect when this setting is applied to Linux. @katlimruiz This is currently a limitation in how the different platforms select a worker that has the correct Node.js version for running your app. It's true that the runtimes are the same on all platforms, but this selection logic is separate from the runtime. |
Is this a problem for regular App Service as well? I've tried setting |
yes linux webapps work the same way wrt WEBSITE_NODE_DEFAULT_VERSION |
@balag0, nope; setting
|
My
WEBSITE_NODE_DEFAULT_VERSION
is~10
, but if I check the actual Node version (context.log(process.version);
) it printsv8.17.0
. Is there another setting that affects the Node.js version?I was pointed at that, when my app crashed with error message
Which seems to be Node.js version related (
for await
supported after v10.0.0).Investigative information
Please provide the following:
Repro steps
context.log(process.version);
Expected behavior
Output:
v10.xx.xx
Actual behavior
Output:
v8.17.0
Related information
The text was updated successfully, but these errors were encountered: