Share via

React app failed when deploy to Azure App Service using Github Actions

Teeravee Sirinapasawasdee 5 Reputation points
2025-10-30T11:23:01.57+00:00

Hi,

My team have been developing web app using React. There is branch name "uat" which I use to integrate with Azure. Everything is fine when Github Actions run and also fine in Log stream in Azure App Service but when browsing to the web I got Azure default page and got ":( Application Error" error message when I use "yarn install && yarn build" in startup command in stack settings. I'm not sure how to see the detailed error messages. If anyone has ideas or experiences on deploying React app in Azure App Service, please share.

Thank you,

Teeravee Sirinapasawasdee (Pound)

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Natheem Yousuf 345 Reputation points
    2025-11-13T05:40:23.98+00:00

    Hey Teeravee Sirinapasawasdee,

    let’s fix the deployment flow.

    Problem: putting yarn install && yarn build in the startup command is incorrect — startup runs at runtime, not during deployment, so Azure serves the default page when wwwroot is empty or missing index.html. Fix by building during CI and deploying the build output to wwwroot, or let App Service build the app during deployment.

    Quick checklist:

    Remove the startup command (or replace it with a runtime command like npx serve -s build only if you need a Node server).

    In your GitHub Actions workflow, build and then deploy the build/ folder — e.g.:

    - name: Install and build
      run: yarn install && yarn build
    
    - name: Deploy to Azure WebApp
      uses: azure/webapps-deploy@v2
      with:
        app-name: 'your-app-name'
        package: ./build
    

    If you prefer App Service to build, set the app setting SCM_DO_BUILD_DURING_DEPLOYMENT=true and deploy source; check deployment logs in Kudu (Advanced Tools) and Log stream for build errors.

    1. Verify index.html exists at /home/site/wwwroot/index.html via Kudu or FTP — if absent, deploy failed.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.