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
windows_first
windows_tools
powershell_heavy
missing_linux_example
Summary
The documentation demonstrates several forms of Windows bias. Windows tools and patterns (e.g., RDP, DPAPI, 'cmd.exe', 'cmd /c') are mentioned before or instead of Linux equivalents. In code examples, Windows-specific commands are used (such as 'cmd.exe /c echo') without providing Linux shell equivalents (like '/bin/bash -c'). The .NET example for named user accounts is split into Windows and Linux, but only the Windows example includes a full command line for running a task under a named user account. Linux-specific instructions are less prominent, and Linux command examples are missing in several places. Additionally, Windows tools (e.g., DPAPI) are referenced without mentioning Linux alternatives.
Recommendations
  • For every example using Windows-specific commands (e.g., 'cmd.exe /c echo'), provide a Linux equivalent (e.g., '/bin/bash -c "echo hello"').
  • When referencing Windows tools like DPAPI, mention Linux alternatives for secret management (e.g., GnuPG, file permissions, or other Linux-native approaches).
  • Ensure that Linux and Windows instructions/examples are presented with equal prominence and in parallel where possible, rather than Windows first.
  • Add explicit Linux code examples for running tasks under named user accounts, including command lines using bash/sh.
  • In introductory sections, mention SSH and Linux access patterns before or alongside RDP and Windows.
  • Review all code snippets and update them to include both Windows and Linux command-line examples where applicable.
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 Biased Biased
2026-01-10 00:00 #92 completed Clean Clean
2026-01-06 22:28 #78 completed Clean Clean
2025-12-29 18:00 #48 cancelled Biased Biased
2025-12-15 00:00 #7 completed Clean Clean
2025-12-14 05:05 #6 completed Clean Clean

Flagged Code Snippets

task.UserIdentity = new UserIdentity(new AutoUserSpecification(elevationLevel: ElevationLevel.Admin, scope: AutoUserScope.Task));
taskToAdd.withId(taskId)
        .withUserIdentity(new UserIdentity()
            .withAutoUser(new AutoUserSpecification()
                .withElevationLevel(ElevationLevel.ADMIN))
                .withScope(AutoUserScope.TASK));
        .withCommandLine("cmd /c echo hello");
user = batchmodels.UserIdentity(
    auto_user=batchmodels.AutoUserSpecification(
        elevation_level=batchmodels.ElevationLevel.admin,
        scope=batchmodels.AutoUserScope.task))
task = batchmodels.TaskAddParameter(
    id='task_1',
    command_line='cmd /c "echo hello world"',
    user_identity=user)
batch_client.task.add(job_id=jobid, task=task)
CloudTask task = new CloudTask("1", "cmd.exe /c echo 1");
task.UserIdentity = new UserIdentity(AdminUserAccountName);
CloudPool pool = null;
Console.WriteLine("Creating pool [{0}]...", poolId);

// Create a pool using Virtual Machine Configuration.
pool = batchClient.PoolOperations.CreatePool(
    poolId: poolId,
    targetDedicatedComputeNodes: 2,
    virtualMachineSize: "standard_d2s_v3",
    VirtualMachineConfiguration: new VirtualMachineConfiguration(
    imageReference: new ImageReference(
                        publisher: "MicrosoftWindowsServer",
                        offer: "WindowsServer",
                        sku: "2022-datacenter-core",
                        version: "latest"),
    nodeAgentSkuId: "batch.node.windows amd64");

// Add named user accounts.
pool.UserAccounts = new List<UserAccount>
{
    new UserAccount("adminUser", "A1bC2d", ElevationLevel.Admin),
    new UserAccount("nonAdminUser", "A1bC2d", ElevationLevel.NonAdmin),
};

// Commit the pool.
await pool.CommitAsync();