Reputation: 4870
Specifying a Node.js version in Azure Bot Service doesn't seem to work.
In Azure portal, navigate to the bot service instance, then in application settings set the environment variable WEBSITE_NODE_DEFAULT_VERSION
to 7.7.4
, which is the highest version available as of 22/05/2017. However it turns out the node.js runtime is still v6.5.0
!
In Kudu -> Environment it shows:
WEBSITE_NODE_DEFAULT_VERSION = 7.7.4
and
Path = D:\home\site\deployments\tools;... D:\Program Files (x86)\nodejs\7.7.4;...
Couldn't find where this v6.5.0 node.js version was set. Maybe in IIS settings? It would be good if azure bot service allows to use customized node.js version rather than the system provided lag version. So is there a fix or work-around? Thanks.
Upvotes: 0
Views: 527
Reputation: 4870
For other people who want to customize their node.js version for their bots, I've found a way: use Azure App Service instead of Azure Bot Service. Here is how:
start Kudu Cmd console
cd D:\home\site\wwwroot
md bin
cd bin
then download the node.js version you like, e.g.
curl -O http://nodejs.org/dist/latest/win-x64/node.exe
<iisnode watchedFiles="web.config;*.js"
nodeProcessCommandLine=""D:\home\site\wwwroot\bin\node.exe""
/>
Following the steps above, you are no longer restricted by the locked node v6.5, and use the latest node.js feature as you wish.
Upvotes: 0
Reputation: 4635
Currently Azure Bot Service (Preview) only supports Node.js v6.5 LTS and does not provide any advanced version configuration options as you described.
Keep in mind that when you create a bot with Azure Bot Service (Preview), you are creating an Azure Functions app (in the background). Azure Functions has their Node.js version locked at v6.5 as described in their documentation.
The node version is currently locked at 6.5.0. We're investigating adding support for more versions and making it configurable.
If you would like to install and run a specific version of Node.js, you will need to setup a VM and configure it to your specifications.
Alternatively, you can deploy your SDK Bot (aka not using Azure Functions) to Azure App Service on Linux (Preview), which will allow you to select a Node.js version in the v6.x LTS range, for example v6.10.2
+ npm v3.10.10
. In this scenario, you must specify the specific Node.js and npm version in your package.json
"engines" section. You can read more about this option in my blog article: Deploying Bot Framework To Azure On Linux
Upvotes: 1