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
⚠️
windows_tools
⚠️
missing_linux_example
Summary:
The documentation page demonstrates a strong Windows and PowerShell bias. Nearly all code examples, parameter definitions, and workflows are presented using PowerShell or PowerShell Workflow, which are Windows-centric technologies. The only mention of Python runbooks is brief and lacks concrete examples, and there are no examples or guidance for Linux shell scripting or CLI-based automation. The documentation assumes the use of Windows tools and patterns (e.g., PowerShell cmdlets, .NET types), and Linux/Unix equivalents are not discussed or demonstrated. Even SDK and REST API examples are shown in C# (another Windows-centric language), and all automation scenarios are illustrated using Windows tools and conventions.
Recommendations:
- Provide equivalent examples for Linux/Unix environments, such as using Bash scripts or Azure CLI to start and manage runbooks.
- Expand the Python runbook section with concrete parameter handling examples, including how to pass parameters from Linux environments.
- Include examples of starting runbooks using Azure CLI (az automation runbook start) and show how to pass parameters from the command line.
- Discuss differences and considerations for users running automation from Linux/macOS, such as authentication and file path handling.
- Balance SDK examples by including Python or JavaScript code snippets, not just C#.
- Clarify which features or patterns are Windows/PowerShell-specific and provide Linux-friendly alternatives where possible.
Create pull request
Flagged Code Snippets
$job = Start-AzAutomationRunbook @RBParams
@{"FirstName"="Joe";"MiddleName"="Bob";"LastName"="Smith"}
IDictionary<string, string> RunbookParameters = new Dictionary<string, string>();
// Add parameters to the dictionary.
RunbookParameters.Add("VMName", "WSVMClassic");
RunbookParameters.Add("resourceGroupName", "WSSC1");
//Call the StartRunbook method with parameters
StartRunbook("Get-AzureVMGraphical", RunbookParameters);
$json = (Get-content -path 'JsonPath\test.json' -Raw) | Out-string
Param
(
[Parameter (Mandatory= $true/$false)]
[Type] $Name1 = <Default value>,
[Parameter (Mandatory= $true/$false)]
[Type] $Name2 = <Default value>
)
[Parameter (Mandatory = $true)]
[object] $FullName
$params = @{"VMName"="WSVMClassic";"resourceGroupeName"="WSVMClassicSG"}
Start-AzAutomationRunbook -AutomationAccountName "TestAutomation" -Name "Get-AzureVMGraphical" –ResourceGroupName $resourceGroupName -Parameters $params
$params = @{"VMName"="WSVMClassic"; "ServiceName"="WSVMClassicSG"}
Start-AzureAutomationRunbook -AutomationAccountName "TestAutomation" -Name "Get-AzureVMGraphical" -Parameters $params
{
"properties":{
"runbook":{
"name":"Get-AzureVMTextual"},
"parameters":{
"VMName":"WindowsVM",
"resourceGroupName":"ContosoSales"}
}
}
Param(
[parameter(Mandatory=$true)]
[object]$json
)
# Ensures you do not inherit an AzContext in your runbook
Disable-AzContextAutosave -Scope Process
# Connect to Azure with system-assigned managed identity
$AzureContext = (Connect-AzAccount -Identity).context
# set and store context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
# Convert object to actual JSON
$json = $json | ConvertFrom-Json
# Use the values from the JSON object as the parameters for your command
Start-AzVM -Name $json.VMName -ResourceGroupName $json.ResourceGroup -DefaultProfile $AzureContext
$JsonParams = @{"json"=$json}
$RBParams = @{
AutomationAccountName = 'AATest'
ResourceGroupName = 'RGTest'
Name = 'Test-Json'
Parameters = $JsonParams
}