Can app service sidecar containers serve requests?

Mark Nevill 0 Reputation points
2024-08-02T17:55:11.0433333+00:00

In the new app service container sidecars (https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container-sidecar), the examples and use-cases (https://learn.microsoft.com/en-us/azure/architecture/patterns/sidecar) all have the main application container serving requests.

In my setup, the "main application" is using php-fpm to expose a local fastcgi port, and requests are handled by what I would consider a "sidecar" nginx container that uses fastcgi_pass to forward relevant requests to the php-fpm port.

I would like to use the sidecar setup (currently using the compose setup, which has many limitations), but I'm not sure if I should be setting the nginx as the sidecar, or the container with the actual appliation code. For clarity it seems like the application container should be the main container, but its not clear from the documentation if a sidecar container can be set up to handle requests.

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2024-08-07T20:17:37.68+00:00

    Hello @Mark Nevill you're right. In your setup, the container with your actual application code (using PHP-FPM) should be the main container, and the Nginx container acting as a reverse proxy should be the sidecar container. This aligns with the concept of sidecar containers in Azure App Service.

    The sidecar pattern is designed to allow the main application to focus on its core responsibilities while the sidecar handles auxiliary tasks. In your case, the Nginx container is handling the routing and forwarding of requests, which is a supportive role

    Best,

    Grace


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.