You can try setting up the start up command as npm run start:prod
instead of next start
.
You can add the start up command in the Azure App Service Deploy task.
- task: AzureRmWebAppDeployment@4
displayName: deploy
inputs:
azureSubscription: 'mysubscription'
...
StartupCommand: 'npm run start:prod'
Or you can set the start up command in Startup Command
under General Settings` in the Configuration blade in your azure web app portal.
When you use npm run start:prod
. You need to make sure the start:prod
command is defined in the scripts
section in the package.json file. See below:
"scripts": {
"build": "tsc -p tsconfig.build.json",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:prod": "node dist/main.js"
Please try archiving your whole project and deploy to azure app service, not just the /dist folder. See this thread.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…