@Cícero Martins Thank you for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.
To test this behavior, we have created a webapp (running on Linux with node 18-lts runtime) through portal from kudu console and by using the cmdlets (node -v, npm -v) we see the node version as 18.14.0 and npm version 6.14.15 as well.
In the above shared .yaml file you have passed the value NODE|18-lts to RuntimeStack
in AzureRmWebAppDeployment@4 task.
As per the AzureRmWebAppDeployment@4 definition documentation the value NODE|18-lts
need to be passed as runtime stack for function app.
You can get the list of supported runtime versions in webapps for Linux runtime use the below cmdlet.
az webapp list-runtimes --os linux | grep NODE
If you want to pin the webapp to specific NodeJS runtime you can add a CLI task in our pipeline and use the below cmdlet.
az webapp config set --resource-group <resource-group-name> --name <app-name> --linux-fx-version "NODE|18-lts"
For reference, you can refer to the example in this blog post on how to deploy react js app using azure devops.
Feel free to reach back to me if you have any further questions on this.