projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

Avoiding hardcod versions of node + WEBSITE_NODE_DEFAULT_VERSION #3505

Closed monil-patel closed 6 months ago

monil-patel commented 8 months ago

Looking for some guidance

In my appservice we had specified a WEBSITE_NODE_DEFAULT_VERSION. But saw that an issnode.yml was still being generated with a hardcoded version of node.js.

Based on this: https://azureossd.github.io/2022/06/24/Avoiding-hardcoding-Node-versions-on-App-Service-Windows/ hardcoding that path is not recommended since azure could update the available versions on the machine.

I believe I found the section of code that handles setting the node.js version. https://github.com/projectkudu/kudu/blob/20239baf6d482861e238505e487b84dc7c4bdc9e/Kudu.Core/Scripts/selectNodeVersion.js#L357C1-L359C47

Is it intended for repos with a package.json engine.node property that a hardcoded path is written to the issnode.yml? The generation of this file took priority over WEBSITE_NODE_DEFAULT_VERSION and it took us some time to understand why.

jvano commented 6 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service