I am trying to deploy a react app to azure app service from visual studio. while creating the app service i choose node 18. when I deploy, all the source code is being deployed instead of just the dist folder. And I get the default app service page. If I choose the dist folder, it errors out saying no source found. what am I missing?
I am trying to deploy a react app to azure app service from visual studio. while creating the app service i choose node 18. when I deploy, all the source code is being deployed instead of just the dist folder. And I get the default app service page. If I choose the dist folder, it errors out saying no source found. what am I missing?
Share Improve this question asked Feb 6 at 4:18 katie77katie77 1,8114 gold badges26 silver badges43 bronze badges 2- Please add more details about the issue. – Harshitha Commented Feb 6 at 4:27
- How you are deploying the app ? Instead of VisualStudio try from VSCode .Refer this SOThread – Harshitha Commented Feb 6 at 4:31
1 Answer
Reset to default 0I have created simple React App deployed to Azure Web App using Vs code, even I'm facing the same issue.
Firstly, Check the Kudu Console If the necessary files are deployed or not by using below URL.
https://<AzureWebName>.scm.canadacentral-01.azurewebsites.net/newui
If the files are not deployed correctly then redeploy it again.
Make sure to run the below command before deploying to Azure using VS Code.
npm run build
Follow the below steps to deploy the app to Azure.
I added below Startup Command in the configuration section of Azure Web App.
pm2 serve /home/site/wwwroot/build --no-daemon --spa
Azure Output: