Unable to deploy NodeJS and React Application on Azure Web App

325 views Asked by At

I am working on the a NodeJS and React application, getting generated from the below command: npm install @microsoft/iot-cardboard-js@beta.

Detailed Link: https://github.com/microsoft/iot-cardboard-js/wiki/Embedding-3D-Scenes

When I deploy the application on the Azure Web App (OS: Linux), it throws different erors everytime:

  1. 3:34:01 PM DigitaltwinsViewer-Linux: Creating an optimized production build... 3:47:26 PM: Error: :( Application ErrorIf you are the application administrator, you can access the <a style="color: grey"href="https://digitaltwinsviewer-linux.scm.azurewebsites.net/detectors">diagnostic resources.

  2. The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9 on the process.

The application is being deployed with the below deployment configuration: SCM_DO_BUILD_DURING_DEPLOYMENT=true

Project Structure:

enter image description here

I tried to deploy the application on the Azure Web App (with Linux OS and Windows OS), but it takes long time and finally azure throws error.

I am trying to deploy from the Visual Studio Code with Azue Extension with below deployment configuration: SCM_DO_BUILD_DURING_DEPLOYMENT=true

Is there anything I am missing or need to make changes to make the deployment successful?

1

There are 1 answers

0
Pravallika KV On
  • Make sure you are deploying the application with all the required files.

  • Check if the NodeJs version in Azure App Service is compatible with the version of @microsoft/iot-cardboard-js@beta.

  • Remove SCM_DO_BUILD_DURING_DEPLOYMENT setting and try deploying again.

  • Run npm run build or npm start before deploying the application.

  • If still issue persists, along with SCM_DO_BUILD_DURING_DEPLOYMENT, try enabling the Oryx build by adding the setting ENABLE_ORYX_BUILD= true in App Service=>Environment Variables=>App Settings.

  • Create a new Azure App Service in any other region and deploy your application using other deployment method like CLI with the command az webapp up --name <webapp_name>.

  1. The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9 on the process.
  • This could be due to the memory issues, Add setting"WEBSITE_NODE_DEFAULT_MEMORY_LIMIT"="512MB".

I have created a simple ReactJs and NodeJs application with the command npx create-react-app <project_name> --template iot-cardboard-js:

enter image description here enter image description here

  • Deployed to Azure App Service successfully via visual studio code and could access the application without any issues.

enter image description here

References:

https://classic.yarnpkg.com/en/package/cra-template-iot-cardboard-js