{"id":37609,"date":"2019-08-08T01:00:31","date_gmt":"2019-08-08T08:00:31","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/premier-developer\/?p=37609"},"modified":"2020-04-21T13:09:09","modified_gmt":"2020-04-21T20:09:09","slug":"configure-azure-app-service-for-64-bit-platform-and-node-js","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/configure-azure-app-service-for-64-bit-platform-and-node-js\/","title":{"rendered":"Configure Azure App Service for 64-bit platform and Node.js"},"content":{"rendered":"<p>App Dev Manager <a href=\"https:\/\/www.linkedin.com\/in\/chris-tjoumas-pmp-9344558\/\">Chris Tjoumas<\/a> explains how to configure Azure Web App to run 64-bit Node.js. This is a follow-up to his <a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/creating-a-ghost-blog-on-an-azure-app-service\/\">previous<\/a> post on deploying <a href=\"https:\/\/ghost.org\/\">Ghost<\/a> on Azure Web App.<\/p>\n<hr \/>\n<p><a class=\"x-hidden-focus\" href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/ghost-update-take-two-64-bit-nodejs\/\">*There is an update to this post as of 4\/18\/20 with additional details for 64 bit support.\u00a0<\/a><\/p>\n<p>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 <a href=\"https:\/\/www.npmjs.com\/package\/sharp\">sharp<\/a> 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 <strong>sharp<\/strong> package is used to convert those posted images into optimized formats for performance. Without a functional <strong>sharp<\/strong> package, the Web App performance will be noticeably slower.<\/p>\n<p>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.<\/p>\n<p>Configure Azure Web App to 64-bit Platform and Node.js:<\/p>\n<ul style=\"list-style-type: circle;\">\n<li>Navigate to your Web App in the Azure Portal<\/li>\n<li>Click on Configuration<\/li>\n<li>Under<strong> Application settings<\/strong>, edit the WEBSITE_NODE_DEFAULT_VERSION and enter 10.15.2 and click Save<\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" width=\"368\" height=\"47\" class=\"wp-image-37610\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-node-d-2.png\" alt=\"Machine generated alternative text: WEBSITE NODE DEFAULT VERSION 10.152 \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-node-d-2.png 368w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-node-d-2-300x38.png 300w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol style=\"list-style-type: lower-roman;\">\n<li>You can identify the installed version by going to Kudu for your app (https:\/\/&lt;your hostname&gt;.scm.azurewebsite.net) and browsing to D:\\Program Files\\nodejs. You&#8217;ll see the version (64-bit since we are under &#8220;Program Files&#8221;) listed here. You can also go to https:\/\/&lt;your hostname&gt;.scm.azurewebsite.net\/api\/diagnostics\/runtime to see the list of NodeJS versions that Azure Web App supports. For example, one of the versions listed for NodeJS is <strong>{&#8220;version&#8221;:&#8221;10.15.2&#8243;,&#8221;npm&#8221;:&#8221;6.4.1&#8243;}<\/strong>, which I&#8217;ll use here.<\/li>\n<li>Verify the node version by running the Kudu console and typing &#8220;<strong>node -v<\/strong>&#8221; (you should see 10.15.2, in this case)<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ul style=\"list-style-type: circle;\">\n<li>Add WEBSITE_NPM_DEFAULT_VERSION and set the value to 6.4.1<\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" width=\"528\" height=\"54\" class=\"wp-image-37611\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-npm-de-2.png\" alt=\"Machine generated alternative text: WEBSITE NPM DEFAULT VERSION q 64.1 \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-npm-de-2.png 528w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/machine-generated-alternative-text-website-npm-de-2-300x31.png 300w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/p>\n<ul style=\"list-style-type: circle;\">\n<li>Click Save.<\/li>\n<li>Click <strong>General settings<\/strong> and change Platform to 64 Bit<\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" width=\"320\" height=\"114\" class=\"wp-image-37612\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/platform-settings-platform-bit-2.png\" alt=\"Platform settings Platform Bit \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/platform-settings-platform-bit-2.png 320w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/08\/platform-settings-platform-bit-2-300x107.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<ul style=\"list-style-type: circle;\">\n<li>Click Save.<\/li>\n<li>Jump over to your source code and edit <strong>iisnode.yml<\/strong> in the root by adding the following:<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\" style=\"padding-left: 40px;\">nodeProcessCommandLine: \"D:\\Program Files\\nodejs\\10.15.2\\node.exe\"<\/pre>\n<ul style=\"list-style-type: circle;\">\n<li>\u00a0Finally, check in your change to kick-off a new build<\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\">Changing the Node.js version in this file will set the run-time environment which <strong>iisnode<\/strong> uses. The kudu command would use the Node.js version set in Application Settings, so it&#8217;s important to set both.<\/p>\n<p>Navigate to your site and verify everything works! Now back to blogging (or fixing any apps which need 64-bit Node.js)!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a follow-up to my original post explaining how to Deploy Ghost CMS on Azure Web App, learn how to configure Azure Web App Platform and Node.js to run as 64-bit, a prerequisite for the latest Ghost build.<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25,1,55],"tags":[24,284,3,99],"class_list":["post-37609","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-permierdev","category-web","tag-azure","tag-node-js","tag-team","tag-web-app"],"acf":[],"blog_post_summary":"<p>As a follow-up to my original post explaining how to Deploy Ghost CMS on Azure Web App, learn how to configure Azure Web App Platform and Node.js to run as 64-bit, a prerequisite for the latest Ghost build.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/37609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=37609"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/37609\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=37609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=37609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=37609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}