node.js - 我们可以在同一个 Azure-App-Service 中部署 nodejs 应用程序和 spring-boot 应用程序吗?
问题描述
我们正在使用 2 个框架来开发后端:
- 节点JS
- 弹簧启动
我们可以在同一个 Azure AppService 实例上部署两个版本吗?有什么建议么?
解决方案
是的。它与其他 SO 线程在运行 Django 的 Azurewebsites 上安装 wordpress和如何在 Azure WebApps 上部署多个应用程序类似。
您可以在路径中部署一个应用程序,并将wwwroot
另一个应用程序部署为另一个子路径中的虚拟应用程序,您在 Azure 门户网站D:\home
的选项卡中配置了虚拟目录和路径。Application settings
这是作为参考的步骤。
- 通过 Kudu 控制台
other
在路径中创建一个目录。site\wwwroot
- 将您的两个应用程序的文件分别上传到路径
wwwroot
和ohter
. - 为不同的应用程序分别在自己的目录中创建
web.config
文件,其内容如下。
启动 SpringBoot jar 的示例配置web.config
,来自Deploying Springboot to Azure App Service
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar "%HOME%\site\wwwroot\ROOT.jar"">
</httpPlatform>
</system.webServer>
</configuration>
Node.js 应用程序的示例配置web.config
,请参阅 wiki 页面Using a custom web.config for Node apps。
注意配置时使用不同的绝对路径,避免名称冲突。
推荐阅读
- python-3.x - Python Pandas:匹配数据框中列的值并将另一列值复制到另一个数据框中
- gitlab - GitLab-CI:限制同一分支的并行管道
- php - 在循环中生成时将表单验证错误消息链接到特定表单实例 - PHP
- java - 如何在java中将方法标记为不鼓励?
- pull-request - AWS CodeCommit 拉取请求中的拆分视图显示意外结果
- r - Xgboost 标签类别如何响应从 xgb.importance 标识的每个变量?
- newrelic - New Relic - .NET IIS 中的自定义属性
- ios - 在 Swift 上使用 AudioKit 反转 InputNode 上的音频相位
- python - Matplotlib 导航工具栏打破 PyQT5 布局中的垂直对齐
- javascript - 如何使用 imageToBase64 在节点中访问然后响应外部承诺