henningst
henningst

Reputation: 1684

Running AtlasBoard on Azure Web App with iisnode

I´m trying to run AtlasBoard in an Azure Web App, but can´t get it to work. I have created a new board using the "Get started in 30 seconds" steps and the demo board runs fine when I start it locally. It works both by starting it with atlasboard start 3333or if I run node start.

I´ve added the node_modules directory to .gitignore.

I´m using git deployment on Azure and this seems to work fine. The deployment log also shows that the npm modules are installed.

This is the last ouput from the deployment:

Using start-up script start.js from package.json.
Generated web.config.
The iisnode.yml file explicitly sets nodeProcessCommandLine. Automatic node.js version selection is turned off.
Selected npm version 3.5.1
npm WARN Invalid name: "HRMTS AtlasBoard"
npm WARN wwwroot No description
npm WARN wwwroot No repository field.
npm WARN wwwroot No README data
npm WARN wwwroot No license field.
Finished successfully.

However, the app doesn´t seem to start and when I look at the log message in the Kudu console, I get this:

Error: error installing D:\home\site\wwwroot\packages\demo
    at process.<anonymous> (D:\Program Files (x86)\iisnode\interceptor.js:73:106)
    at emitOne (events.js:96:13)
    at process.emit (events.js:188:7)
    at process._fatalException (node.js:267:26)

Does anyone have a clue about what´s wrong here?

Upvotes: 0

Views: 266

Answers (1)

Gary Liu
Gary Liu

Reputation: 13918

If you are using the repo of the demo application at https://bitbucket.org/atlassian/atlasboard/src to test on Azure, there several additional modifications we need do to make the test run on Azure Web Apps.

First of all, assume you have successfully deploy the application to Azure, and it failed when start running the application. Then you can leverage Kudu console site or Visual Studio Online extension (refer to the answer of How to install composer on app service? for how to enable extensions of Azure Web Apps) to check the error log at D:\home\site\wwwroot\packages\demo\npm-debug.log.

There are similar errors:

155 error node -v v0.6.20

156 error npm -v 1.1.37

157 error message SSL Error: CERT_UNTRUSTED

It seems that the atlasboard runs command with very low node version on Azure. We can manually modify the dependent scripts to bypass the errors.

If you get error during deployment, you should modify the npm version in package.json before deployment, for example:

"engines": {
    "npm": ">2.0.0",
    "node": ">=0.10"
  },

After deployment:

  • check and modify the port in the start.js in the root directory:

    atlasboard({port: process.env.port||3000 , install: true}, 
    function  (err) {
      if (err) {
        throw err;
      }
    });
    
  • modify the install function in D:\home\site\wwwroot\node_modules\atlasboard\lib\package-dependency-manager.js to use a higher npm version and remove --production param, e.g :

    ...
    var npmCommand = isWindows ? "D:\\Program Files (x86)\\npm\\3.5.1\\npm.cmd" : "npm";
    executeCommand(npmCommand, ["install", pathPackageJson], function(err,     code){
    ...
    })
    

Then restart your website.

Any further concern, please feel free to let me know.

Upvotes: 0

Related Questions