0

I have a frond-end code(REACT for the UI) and a back-end code (Python - backend logic). Currently the whole setup is hosted as a single service inside an Azure webapp (webapp for containers). I am using dockerfile for building the image.

Now, I need to split the FE and BE logic into microservices, meaning two different services, expose them using two different ports, example, 5000 for front end, 5001 for backend and host it on Azure webapp (docker-compose).

How to I test them? I want to know how to access the services using azure webapp URL via different ports. Is that possible in azure webapps? I can test this in local host, example:

http://localhost:5000 --> Front end http://localhost:5001 --> Back end

Manjunath Rao
  • 1,397
  • 4
  • 26
  • 42
  • You can refer to [Open additional ports on Azure Web App](https://stackoverflow.com/a/60720343) and [An example of a Node.js/Express Application deployed in Azure WebApp using Github Actions with single Dockerfile](https://github.com/irvv17/deployment-nodeapp-azure) – Ecstasy Feb 07 '22 at 04:22
  • Can I have two custom ports for one webapp - like a multi container setting? – Manjunath Rao Feb 07 '22 at 04:33
  • 1
    [Access multiple ports in Docker-compose, Azure web app for container.](https://learn.microsoft.com/en-us/answers/questions/447302/access-multiple-ports-in-docker-compose-azure-web.html), [WEBSITES_PORT is not working, only PORT does](https://github.com/MicrosoftDocs/azure-docs/issues/34451) and [Migrate custom software to Azure App Service using a custom container](https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-linux#configure-environment-variables) – Ecstasy Feb 07 '22 at 04:40

1 Answers1

0

As answered by ajkuma-MSFT:

Web App for Containers currently allows you to expose only one port to the outside world. That means that your container can only listen for HTTP requests on a single port.

From Docker compose configuration stand-point : Ports other than 80 and 8080 are ignored.

References: Access multiple ports in Docker-compose, Azure web app for container. - Microsoft Q&A , WEBSITES_PORT is not working, only PORT does · Issue #34451 · MicrosoftDocs/azure-docs · GitHub and Tutorial: Build and run a custom image in Azure App Service - Azure App Service | Microsoft Docs

Madhuraj Vadde
  • 1,099
  • 1
  • 5
  • 13