Shin-chan
Shin-chan

Reputation: 899

Can we deploy nodejs app and spring-boot app in same Azure-App-Service?

We are using 2 frameworks for developing backend:

Can we deploy both builds on the same Azure AppService instance? Any suggestions?

Upvotes: 1

Views: 631

Answers (1)

Peter Pan
Peter Pan

Reputation: 24138

Yes. It's similar with the other SO threads Installing wordpress on Azurewebsites running Django and How to Deploy Multiple Apps on Azure WebApps.

You can deploy an application in the path wwwroot and deploy the other as a virtual application in the other sub-path of D:\home which you configured the virtual directory and path at the tab Application settings of your website on Azure portal.

enter image description here

Here is the steps as reference.

  1. Create a directory like other in the path site\wwwroot via Kudu console.
  2. Upload the files of your two applications separately into the path wwwroot and ohter.
  3. Create the web.config files separately in their own directory for the different applications, and their content as below.

Sample configuration web.config for starting up a SpringBoot jar, which comes from 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 &quot;%HOME%\site\wwwroot\ROOT.jar&quot;">
    </httpPlatform>
  </system.webServer>
</configuration>

Sample configuration web.config for a Node.js application, please refer to the wiki page Using a custom web.config for Node apps.

Note to use the different absolute path for configuration to avoid the name conflict.

Upvotes: 1

Related Questions