reactjsazuredockernext.jsazure-web-app-service

deploying nextjs to azure, but container keeps failing


i am trying to deploy my nextjs app to azure web app, but the port 8080 cant be pinged and thus the website doesnt work.

I have tried defining the port 8080 in the azure env and in my package.json, but that didnt work, i have also tried custom docker files, but no luck. i deploy using github yaml. i have already tried the env of azure by setting website_ports to 8080 but no luck.

this is my yaml file.

`name: Build and deploy Node.js app to Azure Web App - watkanikladen

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Node.js version
        uses: actions/setup-node@v3
        with:
          node-version: '18.x'
      - name: npm install, build
        run: |
          npm install
          npm run build --if-present
      - name: Copy static files
        run: |
          cp -R ./.next/static ./.next/standalone/.next/static
      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: node-app
          path: .next/standalone
          include-hidden-files: true

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
    permissions:
      id-token: write
    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v4
        with:
          name: node-app

      - name: Login to Azure
        uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: 'Deploy to Azure Web App'
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'watkanikladen'
          slot-name: 'Production'
          package: .
`

this is my package.json

`{ "name": "testingazure", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev -p 8080", "build": "next build", "start": "node_modules/next/dist/bin/next start", "lint": "next lint" }, "dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0", "next": "15.1.0" }, "devDependencies": { "typescript": "^5", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", "postcss": "^8", "tailwindcss": "^3.4.1", "eslint": "^9", "eslint-config-next": "15.1.0", "@eslint/eslintrc": "^3" } } and when visiting the page i see this:( Application Error If you are the application administrator, you can access the diagnostic resources.

Also if necessary this is my config next js file

    import type { NextConfig } from "next";
    
    const nextConfig: NextConfig = {
      output: 'standalone'
    };
    
    export default nextConfig;



These are the logs i get when going to the log streams

2024-12-15T13:09:54  Welcome, you are now connected to log-streaming service.Starting Log Tail -n 10 of existing logs ----/home/LogFiles/__lastCheckTime.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)12/15/2024 13:08:59/home/LogFiles/kudu/trace/042e9efd5cde-91f848fe-286b-478e-8534-654cb0d69742.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/042e9efd5cde-91f848fe-286b-478e-8534-654cb0d69742.txt)
2024-12-12T11:15:27  Startup Request, url: /api/settings, method: GET, type: request, pid: 87,1,21, ScmType: GitHubAction/home/LogFiles/kudu/trace/230e88ca82d9-ad899302-5298-4ba2-9a1d-d00f03a11c8e.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/230e88ca82d9-ad899302-5298-4ba2-9a1d-d00f03a11c8e.txt)
2024-12-14T18:37:14  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,15, ScmType: GitHubAction/home/LogFiles/kudu/trace/230e88ca82d9-d7ab882a-6fb1-47c3-9161-035084465387.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/230e88ca82d9-d7ab882a-6fb1-47c3-9161-035084465387.txt)
2024-12-14T18:49:34    Error occurred, type: error, text: LogStreamManager: ProcessRequest end
2024-12-14T18:49:34  Error occurred, type: error, text: LogStreamManager: Inside Reset/home/LogFiles/kudu/trace/46f95f5e2eac-915d5fb0-bc4d-4fd6-ac1e-cb8db995847b.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/46f95f5e2eac-915d5fb0-bc4d-4fd6-ac1e-cb8db995847b.txt)
2024-12-12T13:28:59  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,15, ScmType: GitHubAction/home/LogFiles/kudu/trace/6c5f5174f0dc-ee91a4d7-5613-4f15-b400-63f41f3693bf.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/6c5f5174f0dc-ee91a4d7-5613-4f15-b400-63f41f3693bf.txt)
2024-12-12T09:49:12  Startup Request, url: /api/settings, method: GET, type: request, pid: 92,1,18, ScmType: GitHubAction/home/LogFiles/kudu/trace/782ee94d5158-06829735-55dd-45ce-b9c9-373b9ea9e91c.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/782ee94d5158-06829735-55dd-45ce-b9c9-373b9ea9e91c.txt)
2024-12-14T16:38:48  Startup Request, url: /api/logstream/, method: GET, type: request, pid: 87,1,5, ScmType: GitHubAction/home/LogFiles/kudu/trace/782ee94d5158-41a1c774-9b1a-4eb3-b914-674ccf290844.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/782ee94d5158-41a1c774-9b1a-4eb3-b914-674ccf290844.txt)
2024-12-14T17:43:16    Error occurred, type: error, text: LogStreamManager: ProcessRequest end
2024-12-14T17:43:16  Error occurred, type: error, text: LogStreamManager: Inside Reset/home/LogFiles/kudu/trace/782ee94d5158-cb7c08bd-6450-4e07-8191-635c97cdb631.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/782ee94d5158-cb7c08bd-6450-4e07-8191-635c97cdb631.txt)
2024-12-14T18:35:18    Error occurred, type: error, text: LogStreamManager: ProcessRequest end
2024-12-14T18:35:18  Error occurred, type: error, text: LogStreamManager: Inside Reset/home/LogFiles/kudu/trace/843ddc368926-c2eda81f-b0f5-4d23-994a-4ccc60a8421b.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/843ddc368926-c2eda81f-b0f5-4d23-994a-4ccc60a8421b.txt)
2024-12-12T14:19:13  Startup Request, url: /api/logstream/, method: GET, type: request, pid: 93,1,15, ScmType: GitHubAction/home/LogFiles/kudu/trace/94fa581f70c6-ba511b56-0eba-4825-9cf3-4162167a3508.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/94fa581f70c6-ba511b56-0eba-4825-9cf3-4162167a3508.txt)
2024-12-06T11:16:48  Startup Request, url: /api/deployments/latest?deployer=OneDeploy&time=2024-12-06_11-08-17Z, method: GET, type: request, pid: 87,1,7, ScmType: GitHubAction/home/LogFiles/kudu/trace/9e9bac8f3a56-6c16ac82-9f8c-4693-ada2-896dc7de1fcf.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/9e9bac8f3a56-6c16ac82-9f8c-4693-ada2-896dc7de1fcf.txt)
2024-12-12T14:29:28  Startup Request, url: /api/logstream/, method: GET, type: request, pid: 86,1,7, ScmType: GitHubAction/home/LogFiles/kudu/trace/9e9bac8f3a56-78375c4f-f9a1-40d1-8680-48fc5632471d.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/9e9bac8f3a56-78375c4f-f9a1-40d1-8680-48fc5632471d.txt)
2024-12-12T15:49:50    Error occurred, type: error, text: LogStreamManager: ProcessRequest end
2024-12-12T15:49:50  Error occurred, type: error, text: LogStreamManager: Inside Reset/home/LogFiles/kudu/trace/cf80c5cd088c-0e17a696-56e3-4688-86ed-85993ca228c4.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/cf80c5cd088c-0e17a696-56e3-4688-86ed-85993ca228c4.txt)
2024-12-14T19:02:46  Startup Request, url: /webssh/socket.io/?EIO=4&transport=polling&t=PF6ZJwC&sid=T4v9Z5ZZNfs4dtcuAAAM, method: POST, type: request, pid: 87,1,5, ScmType: GitHubAction/home/LogFiles/kudu/trace/d6414d32f512-c3a659a0-8eb3-49d2-9faf-1c7a70aeea40.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/d6414d32f512-c3a659a0-8eb3-49d2-9faf-1c7a70aeea40.txt)
2024-12-14T19:03:44  Startup Request, url: /webssh/webssh2.css, method: GET, type: request, pid: 92,1,5, ScmType: GitHubAction/home/LogFiles/kudu/trace/d780174ca8f6-0df6f36f-8612-4a47-9b2f-1e0ca00e4201.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/d780174ca8f6-0df6f36f-8612-4a47-9b2f-1e0ca00e4201.txt)
2024-12-12T10:49:07  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,16, ScmType: GitHubAction/home/LogFiles/kudu/trace/watkanikla_kudu_2c8ad654bf-ce32691f-6021-4155-94cf-e3286d3f164b.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_2c8ad654bf-ce32691f-6021-4155-94cf-e3286d3f164b.txt)
2024-12-06T09:40:38  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 86,1,3, ScmType: None/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-07bef1d6-9b55-4c08-a5d4-c5b1e16b3990.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-07bef1d6-9b55-4c08-a5d4-c5b1e16b3990.txt)
2024-12-06T11:06:15  Startup Request, url: /api/deployments/?api-version=2022-03-01, method: GET, type: request, pid: 91,1,7, ScmType: GitHubAction/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-258aa87c-566b-4552-a850-141472ed3751.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-258aa87c-566b-4552-a850-141472ed3751.txt)
2024-12-06T11:09:40    Outgoing response, type: response, statusCode: 409, statusText: Conflict/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-b49086b4-34ac-4d45-82a8-61bf45cbb1a8.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-b49086b4-34ac-4d45-82a8-61bf45cbb1a8.txt)
2024-12-06T11:10:45    Outgoing response, type: response, statusCode: 409, statusText: Conflict/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-b6fb57a8-dab6-4bc0-aa83-92c43e92a241.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-b6fb57a8-dab6-4bc0-aa83-92c43e92a241.txt)
2024-12-06T11:11:44    Outgoing response, type: response, statusCode: 409, statusText: Conflict/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-dacab9a0-d5e1-4240-a5e8-6b3b2dd13bca.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-dacab9a0-d5e1-4240-a5e8-6b3b2dd13bca.txt)
2024-12-06T11:10:02    Outgoing response, type: response, statusCode: 409, statusText: Conflict/home/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-e2c1ef16-dc98-4dca-839c-f744e1d9df60.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_3364c5e582-e2c1ef16-dc98-4dca-839c-f744e1d9df60.txt)
2024-12-06T11:09:25    Outgoing response, type: response, statusCode: 409, statusText: Conflict/home/LogFiles/kudu/trace/watkanikla_kudu_73b9ef8dd3-237833ba-b284-4f1d-bbf0-83bfba24bd80.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_73b9ef8dd3-237833ba-b284-4f1d-bbf0-83bfba24bd80.txt)
2024-12-06T09:31:09  Startup Request, url: /api/deployments/?$orderby=ReceivedTime%20desc&$top=20&api-version=2022-03-01, method: GET, type: request, pid: 87,1,5, ScmType: None/home/LogFiles/kudu/trace/watkanikla_kudu_752ff95adc-25603549-ef14-4eb6-9d0d-809441573d36.txt  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace/watkanikla_kudu_752ff95adc-25603549-ef14-4eb6-9d0d-809441573d36.txt)
2024-12-06T09:54:14  Startup Request, url: /api/deployments/?api-version=2022-03-01, method: GET, type: request, pid: 87,1,5, ScmType: GitHubAction/home/LogFiles/2024_12_06_lw1sdlwk00031K_default_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_06_lw1sdlwk00031K_default_docker.log)
2024-12-06T12:39:59.859216621Z }
2024-12-06T12:39:59.859219221Z
2024-12-06T12:39:59.859221821Z Node.js v20.15.1
2024-12-06T12:40:00.168186031Z npm http fetch GET 200 https://registry.npmjs.org/npm 1531ms
2024-12-06T12:40:00.207154636Z npm notice
2024-12-06T12:40:00.207211037Z npm notice New minor version of npm available! 10.7.0 -> 10.9.2
2024-12-06T12:40:00.207216337Z npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.2
2024-12-06T12:40:00.207219937Z npm notice To update run: npm install -g npm@10.9.2
2024-12-06T12:40:00.207223137Z npm notice/home/LogFiles/2024_12_06_lw1sdlwk00031K_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_06_lw1sdlwk00031K_docker.log)
2024-12-06T11:24:22.313Z ERROR - Container watkanikladen_1_cff24d70 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-12-06T11:24:22.501Z INFO  - Stopping site watkanikladen because it failed during startup.
2024-12-06T12:39:35.834Z INFO  - Starting container for site
2024-12-06T12:39:35.840Z INFO  - docker run -d --expose=8080 --name watkanikladen_1_27ca6636 -e WEBSITE_USE_DIAGNOSTIC_SERVER=true -e WEBSITE_SITE_NAME=watkanikladen -e WEBSITE_AUTH_ENABLED=False -e PORT=8080 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=watkanikladen-g0bnccc2dgfkftbb.westeurope-01.azurewebsites.net -e WEBSITE_INSTANCE_ID=e8de8954d8d4df24779648236e83b1208887924177b072b88b5bc3649a7d7d80 appsvc/node:20-lts_20240819.2.tuxprod
2024-12-06T12:39:35.841Z INFO  - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2024-12-06T12:39:41.526Z INFO  - Initiating warmup request to container watkanikladen_1_27ca6636 for site watkanikladen
2024-12-06T12:40:01.506Z ERROR - Container watkanikladen_1_27ca6636 for site watkanikladen has exited, failing site start
2024-12-06T12:40:01.585Z ERROR - Container watkanikladen_1_27ca6636 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-12-06T12:40:01.739Z INFO  - Stopping site watkanikladen because it failed during startup./home/LogFiles/2024_12_12_lw1sdlwk00031K_default_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_12_lw1sdlwk00031K_default_docker.log)
2024-12-12T15:24:52.182651263Z found 0 vulnerabilities
2024-12-12T15:30:29.681644584Z
2024-12-12T15:30:29.681709685Z up to date, audited 410 packages in 8s
2024-12-12T15:30:29.701452195Z
2024-12-12T15:30:29.701483596Z 145 packages are looking for funding
2024-12-12T15:30:29.701487696Z   run `npm fund` for details
2024-12-12T15:30:29.701490996Z
2024-12-12T15:30:29.701493796Z found 0 vulnerabilities/home/LogFiles/2024_12_12_lw1sdlwk00031K_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_12_lw1sdlwk00031K_docker.log)
2024-12-12T15:30:18.285Z INFO  -  Status: Image is up to date for watkanikladen.azurecr.io/nextjs-app:latest
2024-12-12T15:30:18.297Z INFO  - Pull Image successful, Time taken: 0 Seconds
2024-12-12T15:30:18.465Z INFO  - Starting container for site
2024-12-12T15:30:18.467Z INFO  - docker run -d --expose=8080 --name watkanikladen_1_145c8095 -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e PORT=8080 -e WEBSITES_PORT=8080 -e WEBSITE_SITE_NAME=watkanikladen -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=watkanikladen-g0bnccc2dgfkftbb.westeurope-01.azurewebsites.net -e WEBSITE_INSTANCE_ID=e8de8954d8d4df24779648236e83b1208887924177b072b88b5bc3649a7d7d80 watkanikladen.azurecr.io/nextjs-app:latest REDACTED
2024-12-12T15:30:18.467Z INFO  - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2024-12-12T15:30:21.703Z INFO  - Initiating warmup request to container watkanikladen_1_145c8095 for site watkanikladen
2024-12-12T15:30:37.088Z ERROR - Container watkanikladen_1_145c8095 for site watkanikladen has exited, failing site start
2024-12-12T15:30:37.096Z ERROR - Container watkanikladen_1_145c8095 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-12-12T15:30:37.104Z INFO  - Stopping site watkanikladen because it failed during startup./home/LogFiles/2024_12_14_lw1sdlwk00031K_default_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_14_lw1sdlwk00031K_default_docker.log)
2024-12-14T19:10:26.895661493Z found 0 vulnerabilities
2024-12-14T21:09:56.124622616Z
2024-12-14T21:09:56.124698216Z up to date, audited 463 packages in 8s
2024-12-14T21:09:56.126330433Z
2024-12-14T21:09:56.126346533Z 149 packages are looking for funding
2024-12-14T21:09:56.154232515Z   run `npm fund` for details
2024-12-14T21:09:56.154268116Z
2024-12-14T21:09:56.154272316Z found 0 vulnerabilities/home/LogFiles/2024_12_14_lw1sdlwk00031K_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_14_lw1sdlwk00031K_docker.log)
2024-12-14T21:09:43.815Z INFO  - 560b36c294ba Pull complete
2024-12-14T21:09:43.847Z INFO  -  Digest: sha256:a693a3c15f236836bc21adfd6699096956488731cd836a8f523dde8b0dfb0486
2024-12-14T21:09:43.855Z INFO  -  Status: Downloaded newer image for watkanikladen.azurecr.io/my-nextjs-app:latest
2024-12-14T21:09:43.867Z INFO  - Pull Image successful, Time taken: 118 Seconds
2024-12-14T21:09:44.402Z INFO  - Starting container for site
2024-12-14T21:09:44.402Z INFO  - docker run -d --expose=8080 --name watkanikladen_1_15086bc3 -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e PORT=8080 -e WEBSITES_PORT=8080 -e WEBSITE_SITE_NAME=watkanikladen -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=watkanikladen-g0bnccc2dgfkftbb.westeurope-01.azurewebsites.net -e WEBSITE_INSTANCE_ID=e8de8954d8d4df24779648236e83b1208887924177b072b88b5bc3649a7d7d80 -e HTTP_LOGGING_ENABLED=1 watkanikladen.azurecr.io/my-nextjs-app:latest REDACTED
2024-12-14T21:09:49.764Z INFO  - Initiating warmup request to container watkanikladen_1_15086bc3 for site watkanikladen
2024-12-14T21:10:05.362Z ERROR - Container watkanikladen_1_15086bc3 for site watkanikladen has exited, failing site start
2024-12-14T21:10:05.392Z ERROR - Container watkanikladen_1_15086bc3 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-12-14T21:10:05.538Z INFO  - Stopping site watkanikladen because it failed during startup./home/LogFiles/2024_12_15_lw1sdlwk00031K_default_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_15_lw1sdlwk00031K_default_docker.log)
2024-12-15T12:25:04.703025313Z found 0 vulnerabilities
2024-12-15T13:09:17.411399113Z
2024-12-15T13:09:17.411469914Z up to date, audited 463 packages in 8s
2024-12-15T13:09:17.413069230Z
2024-12-15T13:09:17.420156803Z 149 packages are looking for funding
2024-12-15T13:09:17.420169903Z   run `npm fund` for details
2024-12-15T13:09:17.422729129Z
2024-12-15T13:09:17.422744830Z found 0 vulnerabilities/home/LogFiles/2024_12_15_lw1sdlwk00031K_docker.log  (https://watkanikladen-g0bnccc2dgfkftbb.scm.westeurope-01.azurewebsites.net/api/vfs/LogFiles/2024_12_15_lw1sdlwk00031K_docker.log)
2024-12-15T13:09:03.357Z INFO  - latest Pulling from my-nextjs-app
2024-12-15T13:09:03.408Z INFO  -  Digest: sha256:a693a3c15f236836bc21adfd6699096956488731cd836a8f523dde8b0dfb0486
2024-12-15T13:09:03.409Z INFO  -  Status: Image is up to date for watkanikladen.azurecr.io/my-nextjs-app:latest
2024-12-15T13:09:03.427Z INFO  - Pull Image successful, Time taken: 0 Seconds
2024-12-15T13:09:03.746Z INFO  - Starting container for site
2024-12-15T13:09:03.746Z INFO  - docker run -d --expose=8080 --name watkanikladen_1_233bca4b -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e PORT=8080 -e WEBSITES_PORT=8080 -e WEBSITE_SITE_NAME=watkanikladen -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=watkanikladen-g0bnccc2dgfkftbb.westeurope-01.azurewebsites.net -e WEBSITE_INSTANCE_ID=e8de8954d8d4df24779648236e83b1208887924177b072b88b5bc3649a7d7d80 -e HTTP_LOGGING_ENABLED=1 watkanikladen.azurecr.io/my-nextjs-app:latest REDACTED
2024-12-15T13:09:10.907Z INFO  - Initiating warmup request to container watkanikladen_1_233bca4b for site watkanikladen
2024-12-15T13:09:26.313Z ERROR - Container watkanikladen_1_233bca4b for site watkanikladen has exited, failing site start
2024-12-15T13:09:26.323Z ERROR - Container watkanikladen_1_233bca4b didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-12-15T13:09:26.362Z INFO  - Stopping site watkanikladen because it failed during startup.Ending Log Tail of existing logs ---Starting Live Log Stream ---

Solution

  • I created a sample Next.js app and deployed it to an Azure Web App using GitHub Actions.

    I faced the same issue. To resolve it, follow the steps below.

     "start": "node_modules/next/dist/bin/next start",
    

    package.json:

    {
      "name": "my-nextjs-app",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "dev": "next dev --turbopack",
        "build": "next build",
        "start": "node_modules/next/dist/bin/next start",
        "lint": "next lint"
      },
      "dependencies": {
        "react": "^19.0.0",
        "react-dom": "^19.0.0",
        "next": "15.1.0"
      }
    }
    
     - name: Copy static files
           run: |
             cp -R ./.next/static ./.next/standalone/.next/static
         - name: Upload artifact for deployment job
           uses: actions/upload-artifact@v4
           with:
             name: node-app
             path: .next/standalone
             include-hidden-files: true
    

    Workflow File:

    name: Build and deploy Node.js app to Azure Web App - kanextjsapp
    on:
      push:
        branches:
          - main
      workflow_dispatch:
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - name: Set up Node.js version
            uses: actions/setup-node@v3
            with:
              node-version: '18.x'
          - name: npm install, build
            run: |
              npm install
              npm run build --if-present
          - name: Copy static files
            run: |
              cp -R ./.next/static ./.next/standalone/.next/static
          - name: Upload artifact for deployment job
            uses: actions/upload-artifact@v4
            with:
              name: node-app
              path: .next/standalone
              include-hidden-files: true
      deploy:
        runs-on: ubuntu-latest
        needs: build
        environment:
          name: 'Production'
          url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
        permissions:
          id-token: write 
        steps:
          - name: Download artifact from build job
            uses: actions/download-artifact@v4
            with:
              name: node-app
          - name: Login to Azure
            uses: azure/login@v2
            with:
              client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6E6CEBFFAA06478480E9EA659E2F0064 }}
              tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_4FD3D0706EE046BEAFB4D4A12C00A56C }}
              subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_B0E79F48BB934FABB2AE9329442FFBE8 }}
          - name: 'Deploy to Azure Web App'
            id: deploy-to-webapp
            uses: azure/webapps-deploy@v3
            with:
              app-name: 'kanextjsapp'
              slot-name: 'Production'
              package: .         
    

    After making the above two changes, I successfully deployed the app to Azure.

    Azure Output:

    enter image description here