无法使用Azure Devops将带有Angular应用的Node.js部署到Azure Web应用中 [英] not able to deploy nodejs with angular app into azure web app using azure devops

查看:47
本文介绍了无法使用Azure Devops将带有Angular应用的Node.js部署到Azure Web应用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在天蓝色的DevOps中为MEAN堆栈应用程序创建管道.前端部分是使用带有角度的nodejs构建的,后端部分是使用带有express的nodejs构建的.

I am trying to create a pipeline for the MEAN stack application in azure DevOps. The frontend part is built using nodejs with angular and the backend is built using nodejs with express.

1)在将前端nodejs项目部署到使用azure DevOps构建在nodejs堆栈上的azure Linux Web应用程序中之后,尝试通过URL访问该应用程序时,我被重定向到默认节点页面,而不是我的应用程序.但是,当我在基于asp.net的Windows Web应用程序上使用相同的管道部署相同的应用程序时,可以使用URL访问该应用程序.日志还显示部署成功并且可以服务",是否需要进行任何更改才能访问Linux Web应用程序中部署的应用程序?

1) After deploying the frontend nodejs project into azure Linux web app built on nodejs stack using azure DevOps, while trying to access the app through URL i am redirected to the default node page instead of my application. But when I deploy the same app using the same pipeline on windows web app built on asp.net I can access the application using the URL. Logs also show that "deployment is successful and ready to serve", is there any changes should be made to access the application deployed in Linux web app?

2)如果我在不同的Web应用程序中同时部署了前端和后端,那么代码中相关的URL修改是否足够还是我需要设置任何连接字符串以建立从前端到后端的连接?结束.

2) If I deploy both front-end and back-end in different web apps, whether relevant URL modifications in the code is enough or do I need to set any connection strings to establish a connection from front-end to back-end.

链接到下面提供的构建管道yaml文件的屏幕截图: https://i.stack.imgur.com/OuYfQ.png

Link to screenshot of build pipeline yaml file provided below: https://i.stack.imgur.com/OuYfQ.png

推荐答案

@Levi,感谢您的上述建议.我使用了您在"npx serve -s"上方给出的命令作为发布管道中的启动命令,它对我来说可以通过Internet部署和访问我的应用程序.如果我不使用任何命令,它将路由到默认节点页面.

@Levi, Thanks for the above suggestion. I used the command which you gave above "npx serve -s" as the startup command in the release pipeline and it worked for me to deploy and access my application over the internet. If i don't use any command it was routing to default node page.

这篇关于无法使用Azure Devops将带有Angular应用的Node.js部署到Azure Web应用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆