2

I'm having a problem with the Azure Web Application. The problem is this ... After creating a Web Service that uses a Linux service plan to upload my front-end app that was developed in React.js, the following error started to appear after a day of testing ... when i click on my website link it loads for about 5 minutes (this time can vary up to 15 minutes), and an error appears - :( Application Error , together with a link for Azure Diagnostics. This link takes me to a screen where it shows me some errors and a table with errors 503 and 502.3, I'll put the image here in the post, I just don't know what to do, I started using azure a short time ago and this is my first contact with this type of error.

discussion about the bug in the microsoft community

The link above shows a discussion that I opened in the microsoft community where I followed the tips, however, the error persisted.

In one of my last attempts I cleared my code cache in vsiual studio code and deleted the node modules, after that I executed the command "yarn install" and when I tried to perform the deployment I received a different error with the name "npm ERR! code ELIFECYCLE ”.

As was requested in one of the comments I created a repository and made the code I am trying to deploy for testing available ... follow the link github.com/LucasClaraCloud/project_Frontend-

  • Please update the error information log of `503` and `502.3` and `npm ERR! code ELIFECYCLE`errors in the post. – Jason Pan Mar 24 '21 at 01:38
  • The fastest solution is to recreate a sample code that does not contain any examples of confidential information. We can help you quickly locate the wrong information and solve the problem. – Jason Pan Mar 24 '21 at 01:39
  • @JasonPan As was requested in one of the comments I created a repository and made the code I am trying to deploy for testing available ... follow the link https://github.com/LucasClaraCloud/project_Frontend- – Lucas de Lagos Pandolfi Garcia Mar 25 '21 at 13:07
  • After testing, it is impossible to use github for continuous deployment in the simplest way. The answer I gave has a better choice, at least when redeploying, it takes the least time. – Jason Pan Mar 26 '21 at 06:57
  • If my reply is helpful, please accept it as answer(click on the mark option beside the reply to toggle it from greyed out to fill in.), see https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Jason Pan Mar 26 '21 at 06:57

1 Answers1

2

Your project is too complicated. After testing, I can only provide you with an idea. It works for me

  1. Deploy the build folder generated after npm run build to the /home/site/wwwroot folder path.
  1. Then add startup command on portal with npx serve -s.**

Why

Under normal circumstances, deployment is the folder after deploying the build. The advantages are as follows,

1. Security

This can protect the security of the file code. Generally, few developers will directly deploy source code files to a web server.

2. Fast

The compiled files are relatively small and the deployment is very fast.


Test steps and phenomena::

  1. Use github for continuous deployment. In the git action, the release is successful, but the web page prompts the same as you described, Application Error. View the log the same as yours.

  2. Try to FTP the project file to wwwroot (no node_modules folder), and then execute npm install. It runs for a long time, and finally an error occurs.

Test Result

enter image description here

enter image description here

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • Great day, sorry for the delay to appear here, I'm trying to replicate the steps you described, but, I can't find this folder / home / site / wwwroot. Could you explain in more detail how I do this part? When I look for this folder it gives me the following error "No such file or directory" – Lucas de Lagos Pandolfi Garcia Apr 05 '21 at 14:46
  • @LucasdeLagosPandolfiGarcia You need to open scm site. – Jason Pan Apr 06 '21 at 01:55
  • Thank you @JasonPan, the application is running again, your answer was correct! – Lucas de Lagos Pandolfi Garcia Apr 06 '21 at 13:51
  • Just out of curiosity, when you said that my project was too complicated, you were referring to what exactly? I'm still new to programming and I'm looking for tips to improve my work. Would you have any suggestions to improve the project? – Lucas de Lagos Pandolfi Garcia Apr 06 '21 at 17:12
  • @LucasdeLagosPandolfiGarcia My description is not appropriate. What I said is complicated because this is not an entry-level sample project. There will be many complicated problems when the source file is deployed on IIS, but the folder after compilation only needs to have a webserver, so Will reduce a lot of configuration on iis. Usually our developers are the folders after the build is released. – Jason Pan Apr 07 '21 at 02:10
  • I have another problem with deployment, I opened another post in the community, follow the link (https://stackoverflow.com/questions/67075651/azure-web-application-deployment-successful-but-does-not-update-the-web-applica) – Lucas de Lagos Pandolfi Garcia Apr 13 '21 at 13:23