Recently I've been working with Azure and have been using the Azure CLI to script up creation of a Node.js webapp (btw, the Azure CLI Tools extension is excellent for this). I found however that when scripting up the creation of the webapp, if you specify the
runtime in the format provided in Microsoft's documentation, you get an error.
For example, if you run the following command to create a new webapp with Node.js 12.9:
az webapp create -g myresourcegroup -p myappserviceplan -n myapp --runtime "node|12.9"
You get the following error:
"'12.9' is not recognized as an internal or external command, operable program or batch file."
The error is caused by the
| character which needs to be properly escaped. And the simplest way I've found to do that, is to wrap it in quotes. For example:
az webapp create ... --runtime '"node|12.9"'
That should now work, and if you want to verify the correct version of Node was used, head to the Azure portal and navigate to the webapp you just created and go to Settings > Configuration > General Settings. You'll find the Node.js version listed there.