Where should I put my files on Azure Web app similar to where I put in tomcat/lib folder

Law Chin Yeow 0 Reputation points
2023-10-26T09:21:13.2733333+00:00

Hi,

I created an Azure web app in linux, and successful deploy a war which I place in /home/site/wwwroot/webapps/app.war

my war file needs additional configuration file which I usually place in Tomcat/Lib for local, it works fine.

Where should I put my configuration file in Azure web app to allowed my web app to access and read ? Because I not able to modify the war file.

Thanks,

Chin Yeow

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 18,451 Reputation points
    2023-11-01T23:59:50.2333333+00:00

    Hi @Law Chin Yeow , how did you deploy your Linux web application?

    To allow your web app to access and read your configuration file, you need to place it in the appropriate location in your Azure web app. The location of the configuration file depends on the type of web app you have deployed.

    Here are some options for where you can place external configuration files that need to be accessed by a WAR file deployed to Azure App Service on Linux:

    • Create a /home/site/wwwroot/webapps/conf folder and put your config files there. This is a common location to externalize configs on Azure Web Apps.
    • Set an environment variable like APP_CONFIG_PATH to point to the config folder, e.g. /home/site/config
    • If your app reads a system environment variable like CATALINA_HOME, you can set this to point to a folder like /home/site/tomcat that contains your configs.
    • Add your config files under D:\home\site\wwwroot and access them directly from the drive mount.
    • For Spring apps, use /home/site/wwwroot/application-config folder for external props.
    • Map an Azure file share to /home/site/wwwroot/configs to access files from shared storage.
    • Use the /runtime/config folder which is protected from app changes.

    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.