<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: matti-b-kenobi</title>
    <description>The latest articles on DEV Community by matti-b-kenobi (@whiteanvil).</description>
    <link>https://dev.to/whiteanvil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F24291%2F58957d2f-e6a6-451a-b0d3-f1f8f0756feb.png</url>
      <title>DEV Community: matti-b-kenobi</title>
      <link>https://dev.to/whiteanvil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/whiteanvil"/>
    <language>en</language>
    <item>
      <title>Node, TypeScript, Azure Web Apps — what could go wrong. Lessons learnt guide</title>
      <dc:creator>matti-b-kenobi</dc:creator>
      <pubDate>Wed, 14 Aug 2019 00:49:37 +0000</pubDate>
      <link>https://dev.to/whiteanvil/node-typescript-azure-web-apps-what-could-go-wrong-lessons-learnt-guide-1g92</link>
      <guid>https://dev.to/whiteanvil/node-typescript-azure-web-apps-what-could-go-wrong-lessons-learnt-guide-1g92</guid>
      <description>&lt;p&gt;I have been a convert to Typescript — it was introduced to me via Angular and now I am introducing it to my workflow in the Node.js world.&lt;/p&gt;

&lt;p&gt;Recently I have been building a Node.JS project and deploying this through to an Azure Web App — Why Azure Web App, well I have an MSDN and I have some credit so I thought why not.&lt;/p&gt;

&lt;p&gt;In this post, I am going to build a basic express application using TypeScript, we will build out a couple of controllers (with some basic auth) and then we will use Microsofts DevOps tools to build our server and deploy.&lt;/p&gt;

&lt;p&gt;So why am I doing this- well along the way I hit snags and annoyances and so that other people don't fall down the same potholes I thought I would point out the elements of the pain along the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: This is a very long post. To make it short there is a TLDR.&lt;/p&gt;

&lt;h3&gt;
  
  
  TLDR
&lt;/h3&gt;

&lt;p&gt;I will go through the basic setup of this project end to end I won't bore you — so here are the high-level points&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using TypeScript is awesome 😍&lt;/li&gt;
&lt;li&gt;If you are deploying to Azure Web Apps use port 1377 🤔&lt;/li&gt;
&lt;li&gt;In this project, I have used bcrypt for my password salting and hashing. Because the build tools will build using node 64-bit node your project won't work when it is deployed as it is not a 32-bit app. And Azure Web App only supports 32bit node. In that case, you will need to ship your own version of node 😤&lt;/li&gt;
&lt;li&gt;Your typescript will build to a dist folder, the web.config will need to be placed in there as part of your DevOps build 😃&lt;/li&gt;
&lt;li&gt;Using the Publish Pipeline Artifact will reliably upload your work to the WebApp (it won't time out like FTP upload will) ✨&lt;/li&gt;
&lt;li&gt;Git repo is here &lt;a href="https://github.com/anvilation/azure-webapp-typescript-express" rel="noopener noreferrer"&gt;https://github.com/anvilation/azure-webapp-typescript-express&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Setup
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Node Version
&lt;/h2&gt;

&lt;p&gt;For this project, I am using Node Version 10.14.1. Whilst it is not super critical for this project I know it will match through to the version that I will deploy on Azure (because of the various versions that I play with depending on the project I tend to use &lt;a href="https://github.com/jasongin/nvs" rel="noopener noreferrer"&gt;NVS&lt;/a&gt; to switch up my node versions).&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout
&lt;/h2&gt;

&lt;p&gt;The folder structure that we will be using for this is very simple&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AwkFNBcGhITgfl2Cd9SNebQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AwkFNBcGhITgfl2Cd9SNebQ.png" title="Project Layout" alt="Project Layout"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Packages
&lt;/h3&gt;

&lt;p&gt;Let's get started by installing the following packages. The first is the packages that we are going to use to build this app out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install express helmet body-parser bcrypt reflect-metadata routing-controllers jsonwebtoken --save

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, install the typescript dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install typescript tslint ts-node -save-dev

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally the types&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @types/body-parser @types/express @types/helmet @types/bcrypt @types/jsonwebtoken --save-dev

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  TypeScript
&lt;/h3&gt;

&lt;p&gt;Next we setup TypeScript — now there are a bunch of ways to set this up — but for me, I tend to use the same as the previous projects however you can get away by simply using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tslint --init

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a tslint.json in the root of your project. Finally, we will add a tsconfig.json to the root of this project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es6",
    "noImplicitAny": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "*": ["node_modules/*"]
    },
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "include": ["src/**/*"]
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again — there will be a bunch of options that you may need to add and I am simply bringing forward config from previous projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  package.json
&lt;/h3&gt;

&lt;p&gt;To complete the setup we want to add some additional scripts to the package.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"prebuild": "tslint -c tslint.json -p tsconfig.json --fix",
"build": "tsc",
"dev": "nodemon --watch './src/**/*.ts' --exec ts-node ./src/index.ts",

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Let's build
&lt;/h2&gt;

&lt;p&gt;Let's start with index.ts. Now there is a bunch going on in the code below. Consider this more boilerplate and we will add in details as we go.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import 'reflect-metadata'; // this shim is required
import { useExpressServer, Action } from 'routing-controllers';
import express from 'express';
import helmet from 'helmet';
import * as bodyParser from 'body-parser';
import jwt = require('jsonwebtoken');
// TODO: Controllers 
// Express Server
const loglevel = process.env.LOGLEVEL || 'info';
const port = process.env.PORT || 1337;
const app = express();
// Setup for Production Environment
if (process.env.ENV !== 'development') {
  app.set('trust proxy', true);
  app.use(helmet());
  app.disabled('x-powered-by');
}
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
// Start Server using useExpressServer
useExpressServer(app, {
  errorOverridingMap: {
   ForbiddenError: {
     message: 'Access is denied'
   }
  },
  controllers: []
});
app.listen(port, () =&amp;gt; {
  logger.log(
    {
     level: 'info', 
     message: `SERVER: Server running on: ${port}`
    }
   );
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the code above key points are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the port is set to 1337&lt;/li&gt;
&lt;li&gt;We are using the (router-controller)[&lt;a href="https://github.com/typestack/routing-controllers" rel="noopener noreferrer"&gt;https://github.com/typestack/routing-controllers&lt;/a&gt;] module and using that in conjunction with ExpressJS&lt;/li&gt;
&lt;li&gt;Current there are no controllers configured so this server won't return any data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  First Controller
&lt;/h3&gt;

&lt;p&gt;Let's return some data by creating our first controller.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/controller/index.controller.ts&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Controller, Get, Req, Res } from 'routing-controllers';
@Controller()
export class IndexController {
@Get('/')
  getApi(@Req() request: any, @Res() response: any) {
    return response.send('&amp;lt;h1&amp;gt;Oh hai world&amp;lt;/h1&amp;gt;');
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we may build many controllers we will create an index file on the controllers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/controller/index.ts&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'reflect-metadata'; // this shim is required
import { useExpressServer, Action } from 'routing-controllers';
import express from 'express';
import helmet from 'helmet';
import * as bodyParser from 'body-parser';
import jwt = require('jsonwebtoken');
// TODO: Controllers
import { IndexController } from './controller';
// Express Server
const loglevel = process.env.LOGLEVEL || 'info';
const port = process.env.PORT || 1337;
const app = express();
// Setup for Production Environment
if (process.env.ENV !== 'development') {
  app.set('trust proxy', true);
  app.use(helmet());
  app.disabled('x-powered-by');
}
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
// Start Server using useExpressServer
useExpressServer(app, {
  errorOverridingMap: {
   ForbiddenError: {
     message: 'Access is denied'
   }
  },
  controllers: [ IndexController ]
});
app.listen(port, () =&amp;gt; {
  logger.log(
    {
     level: 'info', 
     message: `SERVER: Server running on: ${port}`
    }
   );
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run, from the console type in npm run dev and confirm that the browser returns a response.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AXTpjBWiM3nTyObzJRonDUQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AXTpjBWiM3nTyObzJRonDUQ.png" title="Oh hai world" alt="Oh hai world"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Authorised Controller
&lt;/h3&gt;

&lt;p&gt;Next, we will create a controller that will authorise a user. This controller will have three methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;login (to enable people to login)&lt;/li&gt;
&lt;li&gt;routewithauth (a route that allows authorised users to access)&lt;/li&gt;
&lt;li&gt;routhwithcurrentuser (a route that is accessible for the current user)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;src/controller/auth.controller.ts&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { JsonController, Post, BodyParam, NotAcceptableError, Authorized, CurrentUser, Req, Res, UnauthorizedError, Get } from 'routing-controllers';
import jwt = require('jsonwebtoken');
import bcrypt from 'bcrypt';
/*
  BIG FAT WARNING
  I am using static usernames and passwords here for illustrative purposes only
*/
@JsonController()
export class LoginController {
  private user = { name: 'user', password: 'muchcomplex' };
  jwtKey = process.env.JWTKEY || 'complexKey';
  private saltRounds = 10;
  constructor() {
    bcrypt.genSalt(this.saltRounds, (err: Error, salt: string) =&amp;gt; {
    bcrypt.hash(this.user.password, salt, (hashErr: Error, hash: string) =&amp;gt; {
      this.user.password = hash;
    });
  });
}
@Post('/login')
login(@BodyParam('user') user: string, @BodyParam('pass') pass: string) {
  if (!user || !pass) {
    // No data supplied
    throw new NotAcceptableError('No Email or Password provided');
  } else if (user !== this.user.name) {
    // No data supplied
    throw new NotAcceptableError('Username Incorrect');
  } else {
    return new Promise&amp;lt;any&amp;gt;((ok, fail) =&amp;gt; {
      bcrypt.compare(pass, this.user.password, (err: Error, result: boolean) =&amp;gt; {
        if (result) {
          const token = jwt.sign({exp: Math.floor(Date.now() / 1000) + 60 * 60, data: { username: this.user.name }
        }, this.jwtKey);
          ok({ token: token }); // Resolve Promise
        } else {
          fail(new UnauthorizedError('Password do not match'));
        }
      });
    });
  }
}
@Authorized()
@Get('/routewauth')
authrequired(@Req() request: any, @Res() response: any) {
  return response.send('&amp;lt;h1&amp;gt;Oh hai authorised world&amp;lt;/h1&amp;gt;');
}
@Authorized()
@Get('/routewacurrentuser')
updatepass( @CurrentUser({ required: true }) currentuser: any, @Res() response: any ) {
  return response.send(`&amp;lt;h1&amp;gt;Oh hai ${currentuser.user} world&amp;lt;/h1&amp;gt;`);
}}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As with the index.controller we add the additional controller:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/controller/index.ts&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export * from './index.controller';
export * from './auth.controller';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we add the controller to the index.ts&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/controller/index.ts&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'reflect-metadata'; // this shim is required
import { useExpressServer, Action } from 'routing-controllers';
import express from 'express';
import helmet from 'helmet';
import * as bodyParser from 'body-parser';
import jwt = require('jsonwebtoken');
// TODO: Controllers
import { IndexController, LoginController } from './controller';
// Express Server
const loglevel = process.env.LOGLEVEL || 'info';
const port = process.env.PORT || 1337;
const app = express();
// Setup for Production Environment
if (process.env.ENV !== 'development') {
  app.set('trust proxy', true);
  app.use(helmet());
  app.disabled('x-powered-by');
}
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
// Start Server using useExpressServer
useExpressServer(app, {
  errorOverridingMap: {
   ForbiddenError: {
     message: 'Access is denied'
   }
  },
  controllers: [ IndexController, LoginController ]
});
app.listen(port, () =&amp;gt; {
  logger.log(
    {
     level: 'info', 
     message: `SERVER: Server running on: ${port}`
    }
   );
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the server and let's check that the new controller works (I am using postman for this).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AFbP0HjlWx3ioBEh4ZN9PeQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AFbP0HjlWx3ioBEh4ZN9PeQ.png" title="Login" alt="Login"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, our authed routes fail.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A5C1qzI2nMP45otA0ak1wCw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A5C1qzI2nMP45otA0ak1wCw.png" title="Route Auth" alt="Route Auth"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let's fix that. To do that we will need to make some adjustments to our main program:&lt;/p&gt;

&lt;p&gt;We will add the JWT key:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;const jwtKey = process.env.JWTKEY || ‘complexKey’;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We will add an authorisation checker param to our useExpressServer command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;authorizationChecker: async (action: Action) =&amp;gt; {
  const token = action.request.headers['authorization'];
  let check: boolean;
  jwt.verify(token, process.env.JWTKEY, (error: any, sucess: any) =&amp;gt; 
  {
    if (error) {
      check = false;
    } else {
      check = true;
    }
   });
   return check;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we will add a currentUserCheck. This will check the token and return some current user information. This comes in two parts — param in the useExpressServer command and an async function that returns the user information. I separate these as there may be additional checks that you might want to do if you scale this out to use a DB instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;currentUserChecker: async (action: Action) =&amp;gt; {
  const token = action.request.headers['authorization'];
  const check = confirmUser(token);
  return check;
},

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The confirmUser method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function confirmUser(token: any) {
  return await new Promise((ok, fail) =&amp;gt; {
   jwt.verify(token, process.env.JWTKEY, (error: any, success: any) =&amp;gt; {
     if (error) {
       fail({ user: null, currentuser: false });
     } else {
       ok({ user: success.data.username, currentuser: true });
     }
    });
  });
}
import 'reflect-metadata'; // this shim is required
import { useExpressServer, Action } from 'routing-controllers';
import express from 'express';
import helmet from 'helmet';
import * as bodyParser from 'body-parser';
import jwt = require('jsonwebtoken');
// TODO: Controllers
import { IndexController, LoginController } from './controller';
// Express Server
const loglevel = process.env.LOGLEVEL || 'info';
const port = process.env.PORT || 1337;
const jwtKey = process.env.JWTKEY || 'complexKey';
const app = express();
// Setup for Production Environment
if (process.env.ENV !== 'development') {
  app.set('trust proxy', true);
  app.use(helmet());
  app.disabled('x-powered-by');
}
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
// Start Server using useExpressServer
useExpressServer(app, {
  errorOverridingMap: {
   ForbiddenError: {
     message: 'Access is denied'
   }
  },
  authorizationChecker: async (action: Action) =&amp;gt; {
    const token = action.request.headers['authorization'];
    let check: boolean;
    jwt.verify(token, jwtKey, (error: any, sucess: any) =&amp;gt;  {
      if (error) { check = false; } else {  check = true;  }
    });
    return check;
  },
  currentUserChecker: async (action: Action) =&amp;gt; {
    const token = action.request.headers['authorization'];
    const check = confirmUser(token);
    return check;
  },
  controllers: [ IndexController, LoginController ]
});
app.listen(port, () =&amp;gt; {
  logger.log(
    {
     level: 'info', 
     message: `SERVER: Server running on: ${port}`
    }
   );
});
async function confirmUser(token: any) {
  return await new Promise((ok, fail) =&amp;gt; {
   jwt.verify(token, jwtKey, (error: any, success: any) =&amp;gt; {
     if (error) {
       fail({ user: null, currentuser: false });
     } else {
       ok({ user: success.data.username, currentuser: true });
     }
    });
  });
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets test again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A76RigQfelIoXomziZSm6Ww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A76RigQfelIoXomziZSm6Ww.png" title="Authorised Route" alt="Authorised Route"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And check current user route&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2ApCXDAW0E_ZcyiWw_AADPxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2ApCXDAW0E_ZcyiWw_AADPxw.png" title="User Route" alt="User Route"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With all that done — lets prepare to deploy this to Azure Web App&lt;/p&gt;




&lt;h2&gt;
  
  
  Deploying to Azure Web App
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create Web App
&lt;/h3&gt;

&lt;p&gt;So lets set up the Azure Web App. Do this is a straight forward process of adding a new WebApp. For this walkthrough, I have changed the plan to the free service plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AjopkSB1CzybQNCBtTNHESQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AjopkSB1CzybQNCBtTNHESQ.png" title="Web App" alt="Web App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once setup you can browse to the resource and confirm it is up and running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Ad9fZDiwCmSJthqsTCvQRrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Ad9fZDiwCmSJthqsTCvQRrg.png" title="Web App" alt="Web App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we go let's make a quick change to the environment variables here. Browse to application settings and update the node version; to do this browse to the Application Settings and add a new setting &lt;em&gt;WEBSITE_NODE_DEFAULT_VERSION&lt;/em&gt; to &lt;em&gt;10.14.1&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Akuu1n3Skg_JsjkcVqRl25w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Akuu1n3Skg_JsjkcVqRl25w.png" title="Web App Config" alt="Web App Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we will update the root that the server will look for:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AUiNJAIEyiN2Il3oYNG2OQw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AUiNJAIEyiN2Il3oYNG2OQw.png" title="Web App Config" alt="Web App Config"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Ready Node project for Azure Deployment
&lt;/h2&gt;

&lt;p&gt;Back to our project and we are going to add two new files to out setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;web.config&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Web.config
&lt;/h3&gt;

&lt;p&gt;This is based upon the IISNode (&lt;a href="https://github.com/tjanczuk/iisnode" rel="noopener noreferrer"&gt;https://github.com/tjanczuk/iisnode&lt;/a&gt;) project. This allows you to run a NodeJS project on IIS (which is the application server on the Azure Web App).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;system.webServer&amp;gt;
        &amp;lt;webSocket enabled="false" /&amp;gt;
        &amp;lt;handlers&amp;gt;
            &amp;lt;add name="iisnode" path="index.js" verb="*" modules="iisnode" /&amp;gt;
        &amp;lt;/handlers&amp;gt;
        &amp;lt;iisnode /&amp;gt;
        &amp;lt;rewrite&amp;gt;
          &amp;lt;rules&amp;gt;
            &amp;lt;rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"&amp;gt;
              &amp;lt;match url="^index.js\/debug[\/]?" /&amp;gt;
            &amp;lt;/rule&amp;gt;
            &amp;lt;rule name="StaticContent"&amp;gt;
              &amp;lt;action type="Rewrite" url="public{REQUEST_URI}"/&amp;gt;
            &amp;lt;/rule&amp;gt;
            &amp;lt;rule name="DynamicContent"&amp;gt;
              &amp;lt;conditions&amp;gt;
                &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/&amp;gt;
              &amp;lt;/conditions&amp;gt;
              &amp;lt;action type="Rewrite" url="index.js"/&amp;gt;
            &amp;lt;/rule&amp;gt;
          &amp;lt;/rules&amp;gt;
        &amp;lt;/rewrite&amp;gt;
        &amp;lt;security&amp;gt;
          &amp;lt;requestFiltering&amp;gt;
            &amp;lt;hiddenSegments&amp;gt;
               &amp;lt;remove segment="bin"/&amp;gt;
            &amp;lt;/hiddenSegments&amp;gt;
         &amp;lt;/requestFiltering&amp;gt;
        &amp;lt;/security&amp;gt;
        &amp;lt;httpErrors existingResponse="PassThrough" /&amp;gt;
    &amp;lt;/system.webServer&amp;gt;
&amp;lt;/configuration&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With all the information committed we are ready to build the Azure DevOps pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure DevOps
&lt;/h3&gt;

&lt;p&gt;There are a number of ways to deploy to an Azure Web App — but for this exercise will use Azure DevOps (&lt;a href="https://azure.microsoft.com/en-au/services/devops/" rel="noopener noreferrer"&gt;https://azure.microsoft.com/en-au/services/devops/&lt;/a&gt;), it is included and it pretty simple to set up with some build Azure friendly functions that we can take advantage of.&lt;/p&gt;

&lt;p&gt;Now again — there are a ton of options with this service including the option of using it as a git like repo — but we only need it for the build for this project so that is what we will use it for.&lt;/p&gt;

&lt;p&gt;At a high level our build will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use the correct version of node&lt;/li&gt;
&lt;li&gt;install global dependencies (typescript and the like)&lt;/li&gt;
&lt;li&gt;install project dependencies&lt;/li&gt;
&lt;li&gt;build the server&lt;/li&gt;
&lt;li&gt;package the files for deploy to the Azure Web Service&lt;/li&gt;
&lt;li&gt;deploy the files to the Azure Web Service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To create a build, select Pipelines &amp;gt; Builds and create a new build&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AKF-oe0OmVG-fZO_v-2NvqQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AKF-oe0OmVG-fZO_v-2NvqQ.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select your repo and click continue to proceed. The first task to add is to add the correct version of node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2ARB-UKIvbXFgUQHeltbTmkA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2ARB-UKIvbXFgUQHeltbTmkA.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;update the options to select 10.14.1&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A7QzS7fGlo55UNnjqtwh5pQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A7QzS7fGlo55UNnjqtwh5pQ.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to add the npm based tasks. Add a new task and select npm and use the following options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A9uVcpq7nJmol7cOBCcOsMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A9uVcpq7nJmol7cOBCcOsMw.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AkbbieS0bcHrfONuRwjl-3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AkbbieS0bcHrfONuRwjl-3g.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AwcvzhAKqPpNp8s2_MJQi6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AwcvzhAKqPpNp8s2_MJQi6g.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to package both the web.config files and our application together. I have chosen to do this in two steps — this is to allow me to create larger mono projects that include a web client and I will build the web client into the final build.&lt;/p&gt;

&lt;p&gt;So go ahead and two new tasks (Copy Files)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AanAYuIWVmebouNO_SRSFeQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AanAYuIWVmebouNO_SRSFeQ.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Am68DOtmdtj29N1Rq9n1GnQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2Am68DOtmdtj29N1Rq9n1GnQ.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AXui1LVvyXcieTSRiC5YxJA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AXui1LVvyXcieTSRiC5YxJA.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we publish the pipeline artefact&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2APmCninoYMXyPCksUKHgR2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2APmCninoYMXyPCksUKHgR2w.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AYB618oVXL87EWB0mhHHbmA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AYB618oVXL87EWB0mhHHbmA.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, we deploy the pipeline artefact to the Azure Web App&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AEejHAy2wxKMML38WGZl59w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AEejHAy2wxKMML38WGZl59w.png" title="DevOp Config" alt="DevOp Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With all that done we can then queue up a build and confirm that everything does.&lt;/p&gt;




&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;We have successfully built out project out and we have gone over to our Azure Web app and browse and see the following&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AY5NzhuG3_cSzR_9Gm5rqEA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AY5NzhuG3_cSzR_9Gm5rqEA.png" title="Updated Web App" alt="Updated Web App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going to the browse on the console I attempt to run the node project manually and I see the following error message:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AOuRPypxEGu-XeeusdZ5xKQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AOuRPypxEGu-XeeusdZ5xKQ.png" title="Errors" alt="Errors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Turns out that Azure web apps do not support 64 but node. There are workarounds here — you can deploy a container, or you can do what has been suggested on the MSDN boards and deploy your own version of node.&lt;/p&gt;

&lt;p&gt;In our project create a new folder called bin and copy the node.exe there&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A7ifeBrJ0uxjzCctvh5LpAA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2A7ifeBrJ0uxjzCctvh5LpAA.png" title="Folder Structure" alt="Folder Structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to ensure that the project will run using the correct version of node. For this, we need to update the web.config&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;system.webServer&amp;gt;
        &amp;lt;webSocket enabled="false" /&amp;gt;
        &amp;lt;handlers&amp;gt;
            &amp;lt;add name="iisnode" path="index.js" verb="*" modules="iisnode" /&amp;gt;
        &amp;lt;/handlers&amp;gt;
        &amp;lt;iisnode nodeProcessCommandLine="d:\home\site\wwwroot\bin\x64\node.exe"/&amp;gt;
&amp;lt;rewrite&amp;gt;
          &amp;lt;rules&amp;gt;
            &amp;lt;rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"&amp;gt;
              &amp;lt;match url="^index.js\/debug[\/]?" /&amp;gt;
            &amp;lt;/rule&amp;gt;
            &amp;lt;rule name="StaticContent"&amp;gt;
              &amp;lt;action type="Rewrite" url="public{REQUEST_URI}"/&amp;gt;
            &amp;lt;/rule&amp;gt;
            &amp;lt;rule name="DynamicContent"&amp;gt;
              &amp;lt;conditions&amp;gt;
                &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/&amp;gt;
              &amp;lt;/conditions&amp;gt;
              &amp;lt;action type="Rewrite" url="index.js"/&amp;gt;
            &amp;lt;/rule&amp;gt;
          &amp;lt;/rules&amp;gt;
        &amp;lt;/rewrite&amp;gt;
        &amp;lt;security&amp;gt;
          &amp;lt;requestFiltering&amp;gt;
            &amp;lt;hiddenSegments&amp;gt;
               &amp;lt;remove segment="bin"/&amp;gt;
            &amp;lt;/hiddenSegments&amp;gt;
         &amp;lt;/requestFiltering&amp;gt;
        &amp;lt;/security&amp;gt;
        &amp;lt;httpErrors existingResponse="PassThrough" /&amp;gt;
    &amp;lt;/system.webServer&amp;gt;
&amp;lt;/configuration&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit these changes and then re-run your DevOps build pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AoRTygjezVqjADf-w07x4Hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F720%2F1%2AoRTygjezVqjADf-w07x4Hw.png" title="Web App" alt="Web App"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;First time playing through — oh my word what a bunch of faff. The issue was mainly that in so many parts of this there is not just one location for an answer there are four or fix. In the end of a lot of the faff would be cut out if Azure Web App would support 64-bit node — there are definitely some people asking for this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Azure/app-service-announcements/issues/22" rel="noopener noreferrer"&gt;https://github.com/Azure/app-service-announcements/issues/22&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/871cc7c7-2917-4c96-b98d-f1e488937b43/azure-website-nodejs-doesnt-run-64-bit?forum=windowsazurewebsitespreview" rel="noopener noreferrer"&gt;https://social.msdn.microsoft.com/Forums/sqlserver/en-US/871cc7c7-2917-4c96-b98d-f1e488937b43/azure-website-nodejs-doesnt-run-64-bit?forum=windowsazurewebsitespreview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the end, I hope this helps the next person who comes along looking to find out the answer to this.&lt;/p&gt;




&lt;p&gt;Connect with Driver Lane on Twitter (&lt;a href="https://twitter.com/driverlane_au" rel="noopener noreferrer"&gt;https://twitter.com/driverlane_au&lt;/a&gt;), and LinkedIn (&lt;a href="https://www.linkedin.com/company/driver-lane/" rel="noopener noreferrer"&gt;https://www.linkedin.com/company/driver-lane/&lt;/a&gt;), or directly on our website (&lt;a href="https://www.driverlane.com.au/" rel="noopener noreferrer"&gt;https://www.driverlane.com.au/&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>azure</category>
      <category>azuredevops</category>
      <category>azurewebapp</category>
    </item>
    <item>
      <title>Hi, I'm matti-b-kenobi</title>
      <dc:creator>matti-b-kenobi</dc:creator>
      <pubDate>Mon, 03 Jul 2017 23:22:40 +0000</pubDate>
      <link>https://dev.to/whiteanvil/hi-im-matti-b-kenobi</link>
      <guid>https://dev.to/whiteanvil/hi-im-matti-b-kenobi</guid>
      <description>&lt;p&gt;I have been coding for 3 years.&lt;/p&gt;

&lt;p&gt;You can find me on Twitter as &lt;a href="https://twitter.com/whiteanvil" rel="noopener noreferrer"&gt;@whiteanvil&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in Melbourne.&lt;/p&gt;

&lt;p&gt;I work for Driver Lane&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: JavaScript.&lt;/p&gt;

&lt;p&gt;I am currently learning more about Angular 4, Auth0, Online payments.&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
