Thanks for the good question.
Just to highlight on how it works on App Service, the Tomcat installations on App Service on Windows exist in shared space on the App Service Plan. You can't directly modify a Tomcat installation for server-wide configuration.
For Linux:
"Adding a shared, server-level data source will require you to edit Tomcat's server.xml. First, upload a startup script and set the path to the script in Configuration > Startup Command. You can upload the startup script using FTP."
For Windows:
To make server-level configuration changes to your Tomcat installation, you must copy Tomcat to a local folder, in which you can modify Tomcat's configuration.
For Windows sites, create a file named startup.cmd or startup.ps1 in the wwwroot directory. This will automatically be executed before the Tomcat server starts.
Please see this doc for more details: configure-data-sources
Based on your requirement, you may adjust the code accordingly.
Please let us know if it helps point you in the right direction, or if I have misunderstood your scenario/requirement. Kindly share more details on your requirement to better assist you.
As a side note, to deploy .war files to Tomcat, use the /api/wardeploy/ endpoint to POST your archive file. For more information on this API, please see this documentation.