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
missing_linux_example
windows_tools
Summary
The documentation page demonstrates a Windows bias by exclusively referencing Windows-based VM images (e.g., 'microsoftwindowsdesktop.windows-11.win11-21h2-pro') in the code sample, omitting any Linux alternatives. Additionally, the 'Next steps' section highlights Azure PowerShell and Az.LabServices cmdlets, which are traditionally more familiar to Windows users, without mentioning cross-platform or Linux-native tools. There are no Linux VM image examples or references to Linux command-line tools.
Recommendations
  • Include examples that use Linux VM images (e.g., Ubuntu, CentOS) in the code samples, either as alternatives or alongside the Windows example.
  • In the 'Next steps' section, add links to Azure CLI documentation and examples, which are cross-platform and widely used on Linux.
  • Explicitly mention that the Python SDK and code samples work on both Windows and Linux, and provide any necessary Linux-specific setup instructions if applicable.
  • Where PowerShell is referenced, also reference Bash or other Linux-native scripting environments to ensure parity.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2026-01-14 00:00 #250 in_progress Biased Biased
2026-01-13 00:00 #246 completed Biased Biased
2026-01-11 00:00 #240 completed Biased Biased
2026-01-10 00:00 #237 completed Biased Biased
2026-01-09 00:34 #234 completed Biased Biased
2026-01-08 00:53 #231 completed Biased Biased
2026-01-06 18:15 #225 cancelled Clean Clean
2025-08-17 00:01 #83 cancelled Clean Clean
2025-07-13 21:37 #48 completed Biased Biased
2025-07-12 23:44 #41 cancelled Biased Biased
2025-07-09 13:09 #3 cancelled Clean Clean
2025-07-08 04:23 #2 cancelled Biased Biased

Flagged Code Snippets

# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

from datetime import timedelta
import time
from azure.identity import DefaultAzureCredential
from azure.mgmt.labservices import LabServicesClient
from azure.mgmt.resource import ResourceManagementClient

def main():

    SUBSCRIPTION_ID = "<Subscription ID>"
    TIME = str(time.time()).replace('.','')
    GROUP_NAME = "BellowsCollege_rg"
    LABPLAN = "BellowsCollege_labplan"
    LAB = "BellowsCollege_lab"
    LOCATION = 'southcentralus'    

    # Create clients
    # # For other authentication approaches, please see: https://pypi.org/project/azure-identity/
    resource_client = ResourceManagementClient(
        credential=DefaultAzureCredential(),
        subscription_id=SUBSCRIPTION_ID
    )
    
    labservices_client = LabServicesClient(
        credential=DefaultAzureCredential(),
        subscription_id=SUBSCRIPTION_ID
    )

    #Get single LabServices Lab Plan
    labservices_labplan = labservices_client.lab_plans.get(GROUP_NAME, LABPLAN)

    print("Get lab plans")
    print(labservices_labplan)

    #Get image information
    LABIMAGES = labservices_client.images.list_by_lab_plan(GROUP_NAME,LABPLAN)
    image = (list(filter(lambda x: (x.name == "microsoftwindowsdesktop.windows-11.win11-21h2-pro"), LABIMAGES)))
    
    #Get lab quota
    USAGEQUOTA = timedelta(hours=10)

    # Password
    CUSTOMPASSWORD = "<custom password>"
    # Create LabServices Lab
    LABBODY = {
        "name": LAB,
        "location" : LOCATION,
        "properties" : {
            "networkProfile": {},
            "connectionProfile" : {
                "webSshAccess" : "None",
                "webRdpAccess" : "None",
                "clientSshAccess" : "None",
                "clientRdpAccess" : "Public"
            },
            "AutoShutdownProfile" : {
                "shutdownOnDisconnect" : "Disabled",
                "shutdownWhenNotConnected" : "Disabled",
                "shutdownOnIdle" : "None"
            },
            "virtualMachineProfile" : {
                "createOption" : "TemplateVM",
                "imageReference" : {
                    "offer": image[0].offer,
                    "publisher": image[0].publisher,
                    "sku": image[0].sku,
                    "version": image[0].version
                },
                "sku" : {
                    "name" : "Classic_Fsv2_2_4GB_128_S_SSD",
                    "capacity" : 2
                },
                "additionalCapabilities" : {
                    "installGpuDrivers" : "Disabled"
                },
                "usageQuota" : USAGEQUOTA,
                "UseSharedPassword" : "Enabled",
                "adminUser" : {
                    "username" : "testuser",
                    "password" : CUSTOMPASSWORD
                }
            },
            "securityProfile" : {
                "openAccess" : "Disabled"
            },
            "rosterProfile" : {},
            "labPlanId" : labservices_labplan.id,
            "title" : "lab-python",
            "description" : "lab 99 description updated"
        }
    }

    poller = labservices_client.labs.begin_create_or_update(
        GROUP_NAME,
        LAB,
        LABBODY
    )

    lab_result = poller.result()
    print(f"Created Lab  {lab_result.name}")

    # Get LabServices Labs
    labservices_lab = labservices_client.labs.get(GROUP_NAME,LAB)
    print("Get lab:\n{}".format(labservices_lab))
    


if __name__ == "__main__":
    main()