0

I am trying to get a node app running on Azure with version 0.11.x of node, so I can take advantage of some new features (e.g. generators & Koa).

I have read this question and tried to follow the steps, with no success so far:

Error setting up node v0.11.x on Azure WebSite

Here are the steps I did:

  1. In VS2013 (update3), File => New Project Choose "Blank Microsoft Azure Node.js Web Application" (under Templates/Javascript/node.js), click OK

  2. In server.js, change the last "hello world" line to show the node version:

    res.end('App running in node version ' + process.version + '\n');

  3. Add a new file "iisnode.yml" in same folder as server.js, with the contents:

    nodeProcessCommandLine: D:\home\site\wwwroot\bin\node.exe

  4. Copy node.exe (version 0.11.13) into the "bin" folder (under the folder where server.js is)

  5. Right-click the project in VS, select Publish, create new Website with all the default credentials/etc... then click Publish

At this point, the "myproj.azurewebsites.net" page comes up with the response:

App running in node version v0.10.29

But I was hoping for node version 0.11.13. If I go to my \bin folder and run node.exe --version it spits out:

v0.11.13

Running locally (F5) seems to do the right thing: App running in node version v0.11.13

I'm fairly stumped how to get node 0.11 running on an Azure web site, any suggestions?

Community
  • 1
  • 1
JohnD
  • 14,327
  • 4
  • 40
  • 53

2 Answers2

0

The following works for me: I have node.exe in d:\home\site\wwwroot and I have the following in my web.config:

<configuration>
   <system.webServer>
     <handlers>
       <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
     </handlers>
     <iisnode nodeProcessCommandLine="d:\home\site\wwwroot\node.exe" />
   </system.webServer>
</configuration>

  • Thanks for the reply Ranjith.. after some investigation it looks like the problem was due to the iisnode.yml file encoding. I'll post a separate answer. – JohnD Aug 25 '14 at 13:43
0

Well I found a workaround to the problem, hopefully this saves someone else some time.

It looks like the problem is that the IISNODE.YML file needs to be ANSI encoded. When I created the file from Visual Studio 2013, it chose UTF8 as the default encoding for the file.

To correct the problem, save the file with ANSI encoding. For eample, you can do this by open the file in notepad, then doing Save As... and pick the Encoding as ANSI.

I looked briefly at the source code for "iisnode" and it appears that the problem is in this code:

CModuleConfiguration::ApplyYamlConfigOverrides

although I didn't have time to test it yet.

JohnD
  • 14,327
  • 4
  • 40
  • 53