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

Bias Types:
⚠️ powershell_heavy
⚠️ windows_first
⚠️ missing_linux_example
Summary:
The documentation page demonstrates a Windows bias in its automation section by providing a detailed PowerShell script for automating environment creation, with no equivalent Bash or Linux shell example. PowerShell is a Windows-centric tool, and its exclusive use may disadvantage Linux users. While the Azure CLI is mentioned briefly, no concrete Linux/Bash example is provided, and the PowerShell workflow is presented first and in detail.
Recommendations:
  • Provide a full example of automating environment creation using Azure CLI in Bash, including a sample script and usage instructions.
  • Present both PowerShell and Bash/Azure CLI examples side by side, or clearly indicate parity between Windows and Linux workflows.
  • Avoid presenting Windows/PowerShell solutions first or exclusively; ensure Linux users are equally supported in automation and scripting scenarios.
  • Explicitly mention any platform-specific requirements or differences, and provide guidance for both Windows and Linux users throughout the documentation.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-07-12 23:44 #41 in_progress ❌ Biased
2025-07-12 00:58 #8 cancelled ✅ Clean
2025-07-10 05:06 #7 processing ✅ Clean

Flagged Code Snippets

#Requires -Module Az.Resources [CmdletBinding()] param ( # ID of the Azure subscription for the lab [string] [Parameter(Mandatory=$true)] $SubscriptionId, # Name of the lab in which to create the environment [string] [Parameter(Mandatory=$true)] $LabName, # Name of the template repository connected to the lab [string] [Parameter(Mandatory=$true)] $RepositoryName, # Name of the template (folder name in the GitHub repository) [string] [Parameter(Mandatory=$true)] $TemplateName, # Name of the environment to create in the lab [string] [Parameter(Mandatory=$true)] $EnvironmentName, # The parameters to pass to the template. Each parameter is prefixed with "-param_". # For example, if the template has a parameter named "TestVMName" with a value of "MyVMName", # the string in $Params is "-param_TestVMName MyVMName". # This convention allows the script to dynamically handle different templates. [Parameter(ValueFromRemainingArguments=$true)] $Params ) # Sign in to Azure, or comment out this statement to completely automate environment creation. Connect-AzAccount # Select the subscription for your lab. Set-AzContext -SubscriptionId $SubscriptionId | Out-Null # Get the user ID to use later in the script. $UserId = $((Get-AzADUser -UserPrincipalName ((Get-AzContext).Account).Id).Id) # Get the lab location. $lab = Get-AzResource -ResourceType "Microsoft.DevTestLab/labs" -Name $LabName if ($lab -eq $null) { throw "Unable to find lab $LabName in subscription $SubscriptionId." } # Get information about the repository connected to your lab. $repository = Get-AzResource -ResourceGroupName $lab.ResourceGroupName ` -ResourceType 'Microsoft.DevTestLab/labs/artifactsources' ` -ResourceName $LabName ` -ApiVersion 2016-05-15 ` | Where-Object { $RepositoryName -in ($_.Name, $_.Properties.displayName) } ` | Select-Object -First 1 if ($repository -eq $null) { throw "Unable to find repository $RepositoryName in lab $LabName." } # Get information about the ARM template base for the environment. $template = Get-AzResource -ResourceGroupName $lab.ResourceGroupName ` -ResourceType "Microsoft.DevTestLab/labs/artifactSources/armTemplates" ` -ResourceName "$LabName/$($repository.Name)" ` -ApiVersion 2016-05-15 ` | Where-Object { $TemplateName -in ($_.Name, $_.Properties.displayName) } ` | Select-Object -First 1 if ($template -eq $null) { throw "Unable to find template $TemplateName in lab $LabName." } # Build the template parameters by using parameter names and values. $parameters = Get-Member -InputObject $template.Properties.contents.parameters -MemberType NoteProperty | Select-Object -ExpandProperty Name $templateParameters = @() # Extract the custom parameters from $Params and format them as name/value pairs. $Params | ForEach-Object { if ($_ -match '^-param_(.*)' -and $Matches[1] -in $parameters) { $name = $Matches[1] } elseif ( $name ) { $templateParameters += @{ "name" = "$name"; "value" = "$_" } $name = $null #reset name variable } } # Create an object to hold the necessary template properties. $templateProperties = @{ "deploymentProperties" = @{ "armTemplateId" = "$($template.ResourceId)"; "parameters" = $templateParameters }; } # Deploy the environment in your lab by using the New-AzResource command. New-AzResource -Location $Lab.Location ` -ResourceGroupName $lab.ResourceGroupName ` -Properties $templateProperties ` -ResourceType 'Microsoft.DevTestLab/labs/users/environments' ` -ResourceName "$LabName/$UserId/$EnvironmentName" ` -ApiVersion '2016-05-15' -Force Write-Output "Environment $EnvironmentName completed."
./deployenv.ps1 -SubscriptionId "000000000-0000-0000-0000-0000000000000" -LabName "mydevtestlab" -ResourceGroupName "mydevtestlabRG000000" -RepositoryName "myRepository" -TemplateName "ARM template folder name" -EnvironmentName "myNewEnvironment"