Configure Azure App Service for 64-bit platform and Node.js

Premier Developer


App Dev Manager Chris Tjoumas explains how to configure Azure Web App to run 64-bit Node.js. This is a follow-up to his previous post on deploying Ghost on Azure Web App.

In my previous post, I explained how to deploy Ghost on Azure Web App; however, Ghost v2.25.5 now requires Node.JS 64-bit to support the sharp package v0.22.1. If you followed my initial instructions to create the free App Service, you will notice that this build will break your post images. The sharp package is used to convert those posted images into optimized formats for performance. Without a functional sharp package, the Web App performance will be noticeably slower.

To fix this issue, you need to configure Azure Web App and Node.js to use 64-bit, which is only available in the App Service Basic Tier and above.

Configure Azure Web App to 64-bit Platform and Node.js:

  • Navigate to your Web App in the Azure Portal
  • Click on Configuration
  • Under Application settings, edit the WEBSITE_NODE_DEFAULT_VERSION and enter 10.15.2 and click Save

Machine generated alternative text: WEBSITE NODE DEFAULT VERSION 10.152

    1. You can identify the installed version by going to Kudu for your app (https://<your hostname> and browsing to D:\Program Files\nodejs. You’ll see the version (64-bit since we are under “Program Files”) listed here. You can also go to https://<your hostname> to see the list of NodeJS versions that Azure Web App supports. For example, one of the versions listed for NodeJS is {“version”:”10.15.2″,”npm”:”6.4.1″}, which I’ll use here.
    2. Verify the node version by running the Kudu console and typing “node -v” (you should see 10.15.2, in this case)
  • Add WEBSITE_NPM_DEFAULT_VERSION and set the value to 6.4.1

Machine generated alternative text: WEBSITE NPM DEFAULT VERSION q 64.1

  • Click Save.
  • Click General settings and change Platform to 64 Bit

Platform settings Platform Bit

  • Click Save.
  • Jump over to your source code and edit iisnode.yml in the root by adding the following:

  • ¬†Finally, check in your change to kick-off a new build

Changing the Node.js version in this file will set the run-time environment which iisnode uses. The kudu command would use the Node.js version set in Application Settings, so it’s important to set both.

Navigate to your site and verify everything works! Now back to blogging (or fixing any apps which need 64-bit Node.js)!

Premier Developer
Premier Developer

Premier Support for Developers

Follow Premier   


Leave a comment

  • Avatar

    Thank you!  One thing to note is that if you have a web.config with an <iisnode> tag then you need to define it like below.  App Services seems to ignore the iisnode.yml when you have the <issnode> tag on your web.config
    <iisnode watchedFiles=”web.config;*.js” debuggingEnabled=”false” nodeProcessCommandLine=”\Program Files\nodejs\10.15.2\node.exe” />

  • Eric Cote
    Eric Cote

    This is not working for me.

    I modified the deploy.cmd to add a line in the deployment section:

    node -p “process.arch”

    This commande simply returns the architecture (“ia32” or “x64”). When I run this in the Windows Azure Kudu deployment, then take a look at the logs, it confirms to me that the node running in deployment still runs in 32 bits. Even though the iisservice runs in 64 bits. Grrrr!

  • Avatar
    M H

    Thank you. I followed your instruction.
    Is it safe to assume that the nodejs runs 64bit by checking the node.exe in the Kudu Process Explorer?
    General Tab:
    file name D:\Program Files\nodejs\12.13.0\node.exe
    command line “D:\Program Files\nodejs\12.13.0\node.exe” “D:\Program Files\iisnode\interceptor.js” “D:\home\site\wwwroot\server\iis.js”

    The Environmental Variables tab of the node.exe process reads:

    Thank you.