Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Thank you for reaching us regarding the issue.
Azure App Service (Linux) sidecar containers do not provide Docker‑Compose‑style networking or DNS service discovery. Containers run in a shared network namespace, and container names are not resolvable as hostnames. Inter‑container communication must be done via localhost and distinct ports.
In Azure App Service (Linux sidecar model), what is the correct hostname format to reference sidecar containers from the main container?
In Azure App Service (Linux) sidecar model, containers do not get separate DNS hostnames and container names (like web or api) cannot be used for routing. All containers share the same network stack, so you should access sidecars using http://localhost:<port>.
Are container names automatically prefixed internally?
No, Microsoft does not provide automatic DNS, FQDNs, or name prefixing for sidecar containers. Their names are only deployment identifiers and cannot be resolved internally by Nginx or other applications.
Is there a recommended way to configure inter-container DNS resolution?
In sidecar-enabled Azure App Service apps, use one main container and run sidecars on different internal ports, accessing them via localhost. Docker-style networking and WEBSITES_PORT do not apply, as sidecars share the same runtime and networking stack under sitecontainers.
Why host not found in upstream occurs
Nginx resolves upstream hostnames during startup, but Azure App Service does not create internal DNS entries for sidecar containers. As a result, hostnames such as web, admin, or api cannot be resolved within the environment.
Why bind() to 0.0.0.0:80 failed (98: Address already in use) occurs
In Azure App Service, all containers share one network namespace, so only the main container can use port 80. Sidecars should run on unique ports, like 3000, 3001, and 1337.
Is Docker Compose networking different from Azure App Service sidecars?
Unlike Docker Compose, which provides service DNS, container name resolution, and separate networks, Azure App Service sidecars do not support these features. Instead, all sidecar containers share the same localhost with the main container, relying on unique internal ports for communication.
Reference:
https://learn.microsoft.com/en-us/azure/app-service/configure-sidecar
https://learn.microsoft.com/en-us/azure/app-service/tutorial-sidecar?tabs=portal
https://learn.microsoft.com/en-us/azure/app-service/migrate-sidecar-multi-container-apps
Kindly let us know if the above comment helps or you need further assistance on this issue.
Please "accept" if the information helped you. This will help us and others in the community as well.