Unable to set locale on web app service from a docker image

Athanasios Polyzos 0 Reputation points
2023-09-12T10:30:35.2233333+00:00

Hi, after creation of a custom docker debian image with locale settings in Dockerfile build, when image is running to Azure Web App, locale remain as POSIX.
With command "locale -a" en_US.utf8 looks installed while with commands "env" & "export" shows that nothing has been set. So need to set new locale to en_US.UTF-8 manually through ssh console on every App service restart.

Dockerfile build include the new setting in "/etc/locale.gen" and env of lang, language, lc_all sets with en_US.UTF-8 but its not working in Azure. Instead, this image run flawlessly to my local docker environment with locale exposed on run.

  • Does it need to expose any environment set into Azure app service application settings to declare the new locale ?
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
419 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,426 Reputation points
    2023-09-14T02:51:21.6066667+00:00

    @Athanasios Polyzos Thanks for reaching out.

    It seems like you have already set the locale in your Dockerfile build and have confirmed that it is installed in the image. However, when you run the image on Azure Web App, the locale remains as POSIX and you need to manually set it to en_US.UTF-8 through SSH console on every App service restart.

    It is possible that the environment variables for the locale are not being set correctly when running the image on Azure Web App. You mentioned that you have set the lang, language, and lc_all environment variables to en_US.UTF-8, but it is not working in Azure.

    One thing you can try is to set the environment variables in the Azure App Service application settings instead of in the Dockerfile.

    Try adding the lang, language, and lc_all environment variables with the value en_US.UTF-8 in the application settings and see if that resolves the issue.

    If this does not work, it is possible that there is an issue with the way the Docker image is being deployed to Azure Web App. In this case, you may need to troubleshoot the deployment process to ensure that the environment variables are being set correctly.

    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.