我们可以在同一Azure应用服务中部署nodejs应用和spring-boot应用吗?

时间:2019-01-22 19:00:17

标签: node.js azure spring-boot azure-web-app-service

我们使用2个框架来开发后端:

  • NodeJS
  • 春季启动

我们可以在同一个Azure AppService实例上部署这两个版本吗? 有什么建议吗?

1 个答案:

答案 0 :(得分:0)

是的。与其他SO线程Installing wordpress on Azurewebsites running DjangoHow to Deploy Multiple Apps on Azure WebApps相似。

您可以在路径wwwroot中部署一个应用程序,并将另一个作为虚拟应用程序部署在D:\home的另一个子路径中,该子路径已在选项卡{{1 }}在Azure门户上的网站上。

enter image description here

以下是参考步骤。

  1. 通过Kudu控制台在路径Application settings中创建一个类似other的目录。
  2. 将两个应用程序的文件分别上传到路径site\wwwrootwwwroot中。
  3. 在不同应用程序的目录中分别创建ohter文件,其内容如下。

用于启动SpringBoot jar的示例配置web.config,来自Deploying Springboot to Azure App Service

web.config

Node.js应用程序的示例配置<?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 &quot;%HOME%\site\wwwroot\ROOT.jar&quot;"> </httpPlatform> </system.webServer> </configuration> ,请参阅Wiki页面Using a custom web.config for Node apps

请注意使用不同的绝对路径进行配置,以避免名称冲突。