title: After Deploying on Azure NextJs App wrapped in Express, app loads forever
body: <p>Hi I am trying to deploy nextjs app using devOps project with server.js which looks like that:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const express = require('express')
  const next = require('next')
      
  const dev = process.env.NODE_ENV !== 'production'
  const app = next({ dev })
  const handle = app.getRequestHandler()
      
  app.prepare()
  .then(() =&gt; {
    var port = process.env.port || 3001
    const server = express()
      
    server.get('*', (req, res) =&gt; {
      return handle(req, res)
    })
      
    server.listen(port, (err) =&gt; {
      if (err) throw err
      console.log('&gt; Ready on http://localhost:433')
    })
  })
  .catch((ex) =&gt; {
    console.error(ex.stack)
    process.exit(1)
  })</code></pre>
  </div>
  </div>
  </p>
  
  <p>For devOPs project I set up github, vsts and then it goes off to azure.</p>
  
  <p>I used the default set up for nodejs, only what I did additionaly in VSTS pipelines I added npm script "npm run build".</p>
  
  <p>My agent job in buld looks like this:</p>
  
  <ul>
  <li>-User node version</li>
  <li>-Npm install application dependencies</li>
  <li>-Npm custom (Added by me, run build)</li>
  <li>-Archive Files</li>
  <li>-Public Artifact drop.</li>
  </ul>
  
  <p>And in release: </p>
  
  <ul>
  <li>Azure Deployment: Create Azure App</li>
  <li>Deploy Azure App Service</li>
  </ul>
  
  <p>The problem is that Build succedes same as release, but then when I try to access the website it loads forever. I did my research but found nothing.</p>
  
  <p>I have been trying to make it work for 3 days now... Please help </p>