skip to Main Content

Created an Azure Linux Web App with Node 18 Stack.

node --version returns 14.19.2

Since hours, I am trying to set the runtime version to 18. What I tried:

  1. Setting WEBSITE_NODE_DEFAULT_VERSION to 18.x or a concrete version, e.g. 18.19.1, restarted. Azure does not care.

  2. Setting the stack manually to Node 18 explicitly under Configuration / General Settings / Stack Settings. Restarted. Azure does not care.

  3. Checked the setting in the cloud shell using

az webapp config show --name axiocontentstrapi --resource-group axio-headless1 | jq '.linuxFxVersion'

Of course, it say NODE 18 while the real node --version is still 14.19.2
Then I tried to reconfigure using

az webapp config set --resource-group axio-headless --name axiocontentstrapi --linux-fx-version "NODE|18-lts"
Azure still doesn’t care.

  1. Checked the DevOps Pipeline setting of my "Deploy to Azure App Service" job. It is set to Node 18.

I need a higher Node version for my App to work. What am I missing?

3

Answers


  1. According to the App Service Linux documentation, your command should have worked.

    Have you tried restarting your App Service Plan? You can do it via the rest API.

    Login or Signup to reply.
  2. It looks like you are trying to check the NodeJS version from the Bash section of Azure Web app which will show Node 14 by default. I have raised a Github issue to get more insights into this issue.

    When I checked the NodeJs version via SSH console it correctly gave Node 18.19.0 version. Refer below:-

    My Azure Linux Web App:-

    enter image description here

    Azure CLI commands:-

    az webapp config show --resource-group siliconrg6543 --name valleywebapp98 --query linuxFxVersion
    az webapp list-runtimes --os linux | grep NODE
    

    enter image description here

    When I SSH into Kudu console by existing and new ui I receive Node 18 version:-

    node --version
    

    enter image description here

    New ui:-

    https://valleywebapp98.scm.azurewebsites.net/newui/webssh
    

    enter image description here

    When I checked Node version in Bash it showed Node 14 version:-

    Azure Web app kudu > Bash output:-

    enter image description here

    New ui:-

    https://valleywebapp98.scm.azurewebsites.net/newui/kududebug
    

    enter image description here

    I have also tried setting the NodeJs Runtime in Azure Devops pipeline still the same issue when accessing the node version from Bash:-

    - task: AzureRmWebAppDeployment@4
                displayName: 'Azure App Service Deploy: valleywebApp98'
                inputs:
                  ConnectionType: 'AzureRM'
                  azureSubscription: 'xxx subscription (0xxxxxxxxx)'
                  appType: 'webAppLinux'
                  WebAppName: '$(webAppName)'
                  packageForLinux: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
                  RuntimeStack: 'NODE|18-lts'
                  StartupCommand: 'npm run start'
                  ScriptType: 'Inline Script'
                  InlineScript: |
                    npm install
                    npm run build --if-present
    

    References:-

    Which versions of node.js are available on Azure Web Sites? – Stack Overflow

    How to fix version mismatch between runtime node version and actual node version – Microsoft Q&A

    Login or Signup to reply.
  3. I can reproduce your issue in Linux Web App. But it works for Windows Web App.

    When run node --version in Kudu Bash, the version returned is 14.19.2.
    enter image description here

    When I run node --version in Kudu SSH, the version returned is 16.13.1.
    enter image description here

    To resolve this issue, you can manually change stack from Configuration -> General Settings -> Stack Settings.
    enter image description here

    Wait for a while and then run node --version from Kudu SSH https://{webappname}.scm.azurewebsites.net/webssh/host. What it should return is 18.19.0.
    enter image description here

    To check the node version installed in the container running your app, you should check in SSH. See the differences between Bash and SSH from this ticket.

    If you set runtimeStack in DevOps pipeline task AzureWebApp@1, ensure to use runtimeStack: 'NODE|18-lts' instead of something like runtimeStack: 'NODE|18.x'.

              - task: AzureWebApp@1
                displayName: 'Azure Web App Deploy'
                inputs:
                  azureSubscription: $(azureSubscription)
                  appType: webAppLinux
                  appName: $(webAppName)
                  runtimeStack: 'NODE|18-lts'
                  package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
                  startUpCommand: 'npm run start'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search