【发布时间】:2019-01-25 16:14:14
【问题描述】:
我们正在使用 2 个框架来开发后端:
- NodeJS
- 弹簧启动
我们可以在同一个 Azure AppService 实例上部署这两个版本吗? 有什么建议吗?
【问题讨论】:
标签: node.js azure spring-boot azure-web-app-service
我们正在使用 2 个框架来开发后端:
我们可以在同一个 Azure AppService 实例上部署这两个版本吗? 有什么建议吗?
【问题讨论】:
标签: node.js azure spring-boot azure-web-app-service
是的。与其他 SO 线程 Installing wordpress on Azurewebsites running Django 和 How to Deploy Multiple Apps on Azure WebApps 类似。
您可以在路径wwwroot 中部署一个应用程序,并将另一个应用程序部署为D:\home 的另一个子路径中的虚拟应用程序,您在您网站的Application settings 选项卡上配置了虚拟目录和路径Azure 门户。
以下是参考步骤。
site\wwwroot 中创建一个类似 other 的目录。wwwroot和ohter。web.config文件,其内容如下。示例配置web.config 用于启动SpringBoot jar,来自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,请参考维基页面Using a custom web.config for Node apps。
注意使用不同的绝对路径进行配置,避免名称冲突。
【讨论】: