Skip to content

Instantly share code, notes, and snippets.

@theisof
Created February 29, 2024 19:40
Show Gist options
  • Save theisof/5b08d932c220a19616e89e4d364ead26 to your computer and use it in GitHub Desktop.
Save theisof/5b08d932c220a19616e89e4d364ead26 to your computer and use it in GitHub Desktop.
Deploy Next.js on Azure App Service
# build and zip, then...
steps:
- task: AzureRmWebAppDeployment@4
displayName: Publish $(app_name)
inputs:
ConnectionType: "AzureRM"
azureSubscription: "$(azure_subscription)"
appType: "webAppLinux"
WebAppName: "$(app_name)"
packageForLinux: "$(System.DefaultWorkingDirectory)/app.zip"
RuntimeStack: "NODE|18-lts"
StartupCommand: "pm2 start ecosystem.config.js --no-daemon"
module.exports = {
apps: [
{
name: "my-app",
script: "./node_modules/next/dist/bin/next",
args: "start -p " + (process.env.PORT || 3000),
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment