Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy next js app to azure app service?

I have been struggling with deploy a next js application to azure app service as we want to render the application both static and dynamic so we need the node server to run. Is any body there is help me.

Note: I have already watched these videos and also applied these methods like adding the web.config and server.js files to root of my website but no luck it does not work. Also this article

https://parveensingh.com/next-js-deployment-on-azure-app-service/

but no luck.

enter image description here

like image 402
Fahad Hameed Avatar asked Dec 09 '25 11:12

Fahad Hameed


1 Answers

A more detailed answer including steps using source control you can refer to.

I also test deploying directly from VS Code, which works fine, too.

Just like the link Monika post, the step to modify package.json you might forget. And make sure your project works well locally before publish to Azure.

package.json:

"scripts": {
    "dev": "node server.js",
    "build": "next build",
    "start": "node server.js"
like image 160
Doris Lv Avatar answered Dec 13 '25 01:12

Doris Lv