Azure App Service : Multi container app with three containers (How to handle) (Java-Sping Application)

Rajasekhar 21 Reputation points
2020-07-10T05:02:18.813+00:00

Azure App Service : Multi container app

I have the use azure app service to deploy my spring application.

Three containers required as part of my requirement ( 2 for app and 1 for DB). App Images are having deployable artifacts (war) and two having different context path (accessing from web url /* and /test) with same port (8080).

> samplecompose.yml
>
> version: '3'
> services:
> Web1:
> image: dockerhub.com/.../AppSample_Web1
> restart: always
> ports:
> - 9080:9080
>
> web2:
> image: dockerhub.com/.../AppSample_Web2
> restart: always
> ports:
> - 9081:9080

DB:
image: dockerhub.com/.../OracleDB..:latest
I tried the above process but am unable to access application pages. How to handle the ports in this case my two containers with same ports

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,704 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,096 Reputation points Microsoft Employee
    2020-07-13T17:11:17.13+00:00

    Hi @Rajasekhar-7195,

    I'm afraid this workflow isn't possbile. You can't host two web images externally. I also see that you're attempting to host your second web app as a virtual directory which also isn't possible. App Service will only bind itself to one web app image and since both of your web apps need to be hosted, you will have to use two separate app services. Therefore, I don't think using container apps is the best hosting for your use case and would suggest simply publishing your app code to two separate app services as instructed here. You can still use your db as a container deployment and use web app storage to persist it if you so choose, but if all you're doing is hosting a db and don't have any special or specific workflows, then I would advise using a hosted database to reduce complexity.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.