Deploy Next JS (Next.js) to Azure App Service
The deployment is simple, yet not well documented. This is the guidance for setting up the normal (i.e. not static) Azure App Service with a NextJs site.
- Run the usual command in cmd/terminal
- Create an App Service in Azure
- Be sure to choose Ubuntu as the operating system
- Go into Configuration, General Settings and set the startup command as;
/home/site/wwwroot/node_modules/next/dist/bin/next start -p $PORT
- I use Microsoft Visual Studio Azure App on to deploy my site as a preference.
- I also run a build before I deploy
npm run build
Posted: 16/12/2021 Author: Jake Jenkins