azureazure-web-app-service

How to see which NodeJS version a web app is running?


I am trying to debug an app that is unable to run and suspect that the issue is node version. It runs fine locally and the minimal reproducible code after is very small.

The documentation says:

az webapp config appsettings list --name <app-name> --resource-group <resource-group-name> --query "[?name=='WEBSITE_NODE_DEFAULT_VERSION'].value"

However this will show the value of the environment variable I set up myself, not the actual version that was chosen for the web app. For example if I write "23.7.0", the command will print it but the web app will never run with this version as it seems Azure do not support it yet (checked by running az webapp list-runtimes)


Solution

  • To check the actual Node.js version your Azure Web App is running,

    You're correct, as the command below shows the default Node.js version (WEBSITE_NODE_DEFAULT_VERSION) that is set in the app settings,but this does not always reflect the actual Node.js version the app is running.

    Windows App Service:

    az webapp config appsettings list --name nodewindows --resource-group v-sirrasneha-mindtree --query "[?name=='WEBSITE_NODE_DEFAULT_VERSION'].value"
    

    enter image description here

    To know the actual node.js version, use the following method:

    Go to Azure portal -> App service(Windows) -> Advanced tools - > Go - > Debug -> CMD -> Run node -v

    enter image description here

    enter image description here

    For Linux App service

    az webapp config show --resource-group <resource-group-name> --name <app-name> --query linuxFxVersion
    

    enter image description here

    enter image description here

    Please refer this doc for better understanding about az webappcommands.

    These methods show the actual Node.js version running in your app.