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
missing_linux_example
windows_first
Summary
The documentation page demonstrates a strong Windows and PowerShell bias. All code examples for creating, invoking, and managing webhooks use PowerShell cmdlets or scripts, with no equivalent examples for Linux-native tools (such as Bash, curl, or Azure CLI). Even REST API examples are shown using PowerShell's Invoke-RestMethod. There are no Bash, curl, or Azure CLI examples, and the only scripting language shown for interacting with Azure Automation is PowerShell. This makes the documentation less accessible for Linux or cross-platform users.
Recommendations
  • Add equivalent examples using Azure CLI for all PowerShell-based operations (creating, updating, deleting webhooks, invoking webhooks, retrieving job output, etc.).
  • Provide REST API examples using curl or HTTPie in Bash, not just PowerShell's Invoke-RestMethod.
  • Include sample scripts in Bash for preparing JSON payloads and invoking webhooks.
  • When showing code tabs, present Azure CLI or Bash/curl examples before or alongside PowerShell, not only after.
  • Explicitly mention cross-platform compatibility and provide guidance for Linux/macOS users.
  • Where possible, use neutral language (e.g., 'command line' instead of 'PowerShell prompt') and avoid assuming a Windows environment.
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-12 00:00 #243 cancelled 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-16 00:00 #52 completed Biased Biased
2025-07-13 21:37 #48 completed Biased Biased
2025-07-09 13:09 #3 cancelled Clean Clean
2025-07-08 04:23 #2 cancelled Biased Biased

Flagged Code Snippets

        # Sign in to your Azure subscription
        $sub = Get-AzSubscription -ErrorAction SilentlyContinue
        if(-not($sub))
        {
            Connect-AzAccount
        }
        
    param
    (
        [Parameter(Mandatory=$false)]
        [object] $WebhookData
    )

    write-output "start"
    write-output ("object type: {0}" -f $WebhookData.gettype())
    write-output $WebhookData
    write-output "`n`n"
    write-output $WebhookData.WebhookName
    write-output $WebhookData.RequestBody
    write-output $WebhookData.RequestHeader
    write-output "end"

    if ($WebhookData.RequestBody) { 
        $names = (ConvertFrom-Json -InputObject $WebhookData.RequestBody)

            foreach ($x in $names)
            {
                $name = $x.Name
                Write-Output "Hello $name"
            }
    }
    else {
        Write-Output "Hello World!"
    }
    
        # Initialize variables with your relevant values
        $resourceGroup = "resourceGroupName"
        $automationAccount = "automationAccountName"
        $runbook = "runbookName"
        $psWebhook = "webhookName"
        
        # Create webhook
        $newWebhook = New-AzAutomationWebhook `
            -ResourceGroup $resourceGroup `
            -AutomationAccountName $automationAccount `
            -Name $psWebhook `
            -RunbookName $runbook `
            -IsEnabled $True `
            -ExpiryTime "12/31/2022" `
            -Force
        
        # Store URL in variable; reveal variable
        $uri = $newWebhook.WebhookURI
        $uri
        
        Get-AzAutomationWebhook `
            -ResourceGroup $resourceGroup `
            -AutomationAccountName $automationAccount `
            -Name $psWebhook
        
        # Sign in to your Azure subscription
        $sub = Get-AzSubscription -ErrorAction SilentlyContinue
        if(-not($sub))
        {
            Connect-AzAccount
        }
        
        # Initialize variables
        $subscription = "subscriptionID"
        $resourceGroup = "resourceGroup"
        $automationAccount = "automationAccount"
        $runbook = "runbookName"
        $restWebhook = "webhookName"
        $file = "path\webhook.json"

        # consume file
        $body = Get-Content $file
        
        # Craft Uri
        $restURI = "https://management.azure.com/subscriptions/$subscription/resourceGroups/$resourceGroup/providers/Microsoft.Automation/automationAccounts/$automationAccount/webhooks/$restWebhook`?api-version=2015-10-31"
        
        # Obtain access token
        $azContext = Get-AzContext
        $azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
        $profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($azProfile)
        $token = $profileClient.AcquireAccessToken($azContext.Subscription.TenantId)
        $authHeader = @{
            'Content-Type'='application/json'
            'Authorization'='Bearer ' + $token.AccessToken
        }
        
        # Invoke the REST API
        # Store URL in variable; reveal variable
        $response = Invoke-RestMethod -Uri $restURI -Method Put -Headers $authHeader -Body $body
        $webhookURI = $response.properties.uri
        $webhookURI
        
        $response = Invoke-RestMethod -Uri $restURI -Method GET -Headers $authHeader
        $response | ConvertTo-Json
        
    $Names  = @(
                @{ Name="Hawaii"},
                @{ Name="Seattle"},
                @{ Name="Florida"}
            )
    
    $body = ConvertTo-Json -InputObject $Names
    
    # Revise file path with actual path
    $file = "path\names.json"
    $bodyFile = Get-Content -Path $file 
    
    $response = Invoke-WebRequest -Method Post -Uri $webhookURI -Body $body -UseBasicParsing
    $response
    
    $responseFile = Invoke-WebRequest -Method Post -Uri $webhookURI -Body $bodyFile -UseBasicParsing
    $responseFile
    
    #isolate job ID
    $jobid = (ConvertFrom-Json ($response.Content)).jobids[0]
    
    # Get output
    Get-AzAutomationJobOutput `
        -AutomationAccountName $automationAccount `
        -Id $jobid `
        -ResourceGroupName $resourceGroup `
        -Stream Output
    
    Remove-AzAutomationWebhook `
        -ResourceGroup $resourceGroup `
        -AutomationAccountName $automationAccount `
        -Name $psWebhook
    
    Invoke-WebRequest -Method Delete -Uri $restURI -Headers $authHeader
    
    $resourceGroup = "resourceGroup"
    $templateFile = "path\webhook_deploy.json"
    $armAutomationAccount = "automationAccount"
    $armRunbook = "ARMrunbookName"
    $armWebhook = "webhookName"
    $webhookExpiryTime = "12-31-2022"
    
    New-AzResourceGroupDeployment `
        -Name "testDeployment" `
        -ResourceGroupName $resourceGroup `
        -TemplateFile $templateFile `
        -automationAccountName $armAutomationAccount `
        -runbookName $armRunbook `
        -webhookName $armWebhook `
        -WebhookExpiryTime $webhookExpiryTime