Running Next.js on Azure App Services

David Fekke
CodeX
Published in
2 min readApr 28, 2021

--

Photo Illustration by David Fekke

Originally published at https://fek.io.

How to run your Next.js app on Azure

I recently gave a presentation on building universal apps using Next.js and Express.js. Next.js is a framework from the great people at Vercel.

Vercel is a great hosting platform, but I am working on a project that is already using resources on the Azure platform, so I decided to host it there instead of at Vercel or another platform as a service.

I ran into a problem when I tried to deploy my Next.js app on Azure App Services. Azure already provides a several ways of deploying apps using continuous integration through git repos. You can configure your app service to pull from your repo every time a change is pushed. The problem is that you have to specify a port. Here is how you can configure a port in your code and package.json.

The express part of your express app needs to be able use port provided Azure. Make the following change to your Express app;

--

--

David Fekke
CodeX

I am a software engineer and commercial pilot in jacksonville, Fl. I also produce videos for the Polyglot Engineer Channel on YouTube.