Sad Tux - Windows bias detected
This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Detected Bias Types
powershell_heavy
windows_tools
windows_first
Summary
The documentation provides both Linux and Windows instructions for configuring data sources in Tomcat and JBoss on Azure App Service. However, the Windows section is notably more detailed, with extensive PowerShell scripting and Windows-specific patterns (e.g., startup.cmd, configure.ps1, use of %HOME%, %LOCAL_EXPANDED%, and Windows environment variables). The Linux instructions are more concise and rely on standard shell scripting and package installation, but lack the depth and step-by-step guidance found in the Windows examples. The Windows configuration uses PowerShell and Windows batch files, while the Linux configuration uses shell scripts and standard Linux tools, but the Windows approach is described with more explicit detail and troubleshooting steps. Additionally, Windows-specific tools and patterns (PowerShell, batch files, Windows environment variables) are emphasized, and the Windows section appears before the Linux section in the shared server-level resources area.
Recommendations
  • Expand the Linux section to provide equally detailed, step-by-step instructions, including troubleshooting tips and example scripts for common scenarios.
  • Provide Linux equivalents for all Windows-specific tools and patterns (e.g., show how to automate configuration with Bash scripts, use environment variables, and manage ephemeral file changes).
  • Ensure that Linux instructions appear before or alongside Windows instructions in each section to avoid implicit prioritization.
  • Include example startup scripts for Linux that match the complexity and completeness of the Windows PowerShell scripts.
  • Add more guidance on managing Tomcat/JBoss configuration files in Linux, including handling ephemeral storage and persistent configuration.
  • Where possible, use cross-platform tools and patterns (e.g., Azure CLI, environment variables) in examples to reduce platform-specific bias.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2026-01-12 00:00 #99 completed Biased Biased
2026-01-11 06:20 #98 completed Clean Clean
2026-01-11 00:00 #95 cancelled Clean Clean
2026-01-10 00:00 #92 completed Clean Clean
2026-01-09 00:00 #87 cancelled Clean Clean
2026-01-08 00:00 #84 in_progress Clean Clean
2026-01-06 22:28 #78 completed Biased Biased
2025-12-29 18:00 #48 cancelled Biased Biased
2025-12-22 00:00 #24 cancelled Clean Clean
2025-12-15 00:00 #7 completed Clean Clean
2025-12-14 05:05 #6 completed Clean Clean

Flagged Code Snippets

If you created a server-level data source, restart the App Service Linux application. Tomcat resets `CATALINA_BASE` to `/home/tomcat` and uses the updated configuration.

# [Windows](#tab/windows)

You can't directly modify a Tomcat installation for server-wide configuration because the installation location is read-only. To make server-level configuration changes to your Windows Tomcat installation, the simplest way is to do the following on app start: 

1. Copy Tomcat to a local directory (`%LOCAL_EXPANDED%`) and use that as `CATALINA_BASE` (see [Tomcat documentation on this variable](https://tomcat.apache.org/tomcat-10.1-doc/introduction.html)).
1. Add your shared data sources to `%LOCAL_EXPANDED%\tomcat\conf\server.xml` using XSL transform.

#### Add a startup file

Create a file named `startup.cmd` in the `%HOME%\site\wwwroot` directory. This file runs automatically before the Tomcat server starts. The file should have the following content:

This PowerShell completes the following steps:

1. Check whether a custom Tomcat copy exists already. If it does, the startup script can end here.
2. Copy Tomcat locally.
3. Add shared data sources to the custom Tomcat's configuration using XSL transform.
4. Indicate that configuration was successfully completed.

#### Add XSL transform file

A common use case for customizing the built-in Tomcat installation is to modify the `server.xml`, `context.xml`, or `web.xml` Tomcat configuration files. App Service already modifies these files to provide platform features. To continue to use these features, it's important to preserve the content of these files when you make changes to them. To accomplish this, use an [XSL transformation (XSLT)](https://www.w3schools.com/xml/xsl_intro.asp).

Add an XSL transform file called *configure.ps1* to the *%HOME%_\site* directory. You can use the following XSL transform code to add a new connector node to `server.xml`. The *identity transform* at the beginning  preserves the original contents of the configuration file.