Web App for Containers: sidecar containers can't see the environment variables

Carol Lai 0 Reputation points
2025-02-26T03:38:13.4466667+00:00

I have a Web App for Containers. I use the Deployment Center on Azure Portal to configure the containers. I use the advanced sidecar container support to add a main container and 2 sidecar containers. All three containers use the same image that is stored in Azure Container Registry.

When I first start this Web App, everything run well. All containers can see the environment variables defined under settings. Then if I stop and restart a few times. The main container still see the environment variables, but the sidecar containers will not be able to see the environment variables anymore.

I'm not sure how to fix this problem.

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

1 answer

Sort by: Most helpful
  1. Bhargavi Naragani 1,045 Reputation points Microsoft External Staff
    2025-02-28T06:35:32.4+00:00

    Hi @Carol Lai,

    Apologies for the inconvenience caused. We received your feedback that the answer provided on the thread was not helpful.

    It's unexpected that your sidecar containers are no longer able to access the environment variables after a few restarts, particularly since you've placed them in the Web App settings as you're supposed to. Under normal circumstances, those settings should apply to all of your containers, including the main one and the sidecars. But sometimes the settings aren't propagated properly.

    Double-verify that environment variables are defined at the Web App level (Configuration => Application settings in the Azure Portal) and ensure that the variables are selected as Application Setting and that they are not isolated to a specific container.

    Occasionally, restarts or redeployments may cause inconsistent propagation. If the Web App settings panel is not functioning reliably, you can specify environment variables within the container definition in the Deployment Center YAML or through an ARM template. Navigate to Web App => Logs and see if any errors are present when the sidecars attempt to start.

    Incomplete environment variables can be associated with startup problems. Rather than stopping and restarting, use the Restart button within the Azure Portal instead. If this persists, you can try triggering a redeployment from the Deployment Center, which tends to reset environment variable propagation.

    As you already followed Azure App Service - Sidecar Containers tutorial, if issue continues, refer this: Configure environment variables in Azure App Service.

    I have provided a detailed answer which has clear steps for which you are looking for. If you wish, you may re-surveying for the engagement you received on the thread. Your feedback is very important to us.

    Looking forward to your reply. Much appreciate your feedback!  


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.