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:
-
Setting
WEBSITE_NODE_DEFAULT_VERSION
to18.x
or a concrete version, e.g.18.19.1
, restarted. Azure does not care. -
Setting the stack manually to Node 18 explicitly under Configuration / General Settings / Stack Settings. Restarted. Azure does not care.
-
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.
- 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
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.
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:-
Azure CLI commands:-
When I
SSH into Kudu console
by existing and new ui I receiveNode 18
version:-New ui:-
When I checked Node version in Bash it showed Node 14 version:-
Azure Web app kudu > Bash output:-
New ui:-
I have also tried setting the NodeJs Runtime in Azure Devops pipeline still the same issue when accessing the node version from Bash:-
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
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.When I run
node --version
in Kudu SSH, the version returned is 16.13.1.To resolve this issue, you can manually change stack from Configuration -> General Settings -> Stack Settings.
Wait for a while and then run
node --version
from Kudu SSHhttps://{webappname}.scm.azurewebsites.net/webssh/host
. What it should return is 18.19.0.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 taskAzureWebApp@1
, ensure to useruntimeStack: 'NODE|18-lts'
instead of something likeruntimeStack: 'NODE|18.x'
.