最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Deploying a React app to Azure App Service - Stack Overflow

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

I 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:

发布评论

评论列表(0)

  1. 暂无评论