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 is heavily focused on Windows and PowerShell usage, with all command-line examples and tooling instructions centered around PowerShell cmdlets and Windows-specific patterns. Linux or cross-platform CLI alternatives are not mentioned, and there are no examples using Bash, Azure CLI, or other Linux-native tools. The Python examples are present but limited to the Azure Automation Python SDK, not general Linux workflows. The documentation assumes a Windows/PowerShell environment for automation tasks.
Recommendations:
- Add equivalent examples using Azure CLI (az) commands for credential management, which are cross-platform and work natively on Linux.
- Include Bash or shell script examples for retrieving and using credentials in runbooks, especially for Linux Hybrid Runbook Workers.
- Mention and document how Linux users can interact with Azure Automation credentials, including any SDKs or REST API usage.
- Avoid referring to 'Windows PowerShell' exclusively; use 'PowerShell' and clarify cross-platform compatibility where possible.
- List Linux-compatible tools and workflows alongside PowerShell cmdlets, and avoid presenting Windows tools first or exclusively.
- Clarify which features or modules are available on Linux-based Automation workers and provide parity guidance.
Create pull request
Flagged Code Snippets
# 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
# Get credential
$myCred = Get-AutomationPSCredential -Name "MyCredential"
$userName = $myCred.UserName
$securePassword = $myCred.Password
$password = $myCred.GetNetworkCredential().Password
$myPsCred = New-Object System.Management.Automation.PSCredential ($userName,$securePassword)
# Connect to Azure with credential
$AzureContext = (Connect-AzAccount -Credential $myPsCred -TenantId $AzureContext.Subscription.TenantId).context
# set and store context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription `
-TenantId $AzureContext.Subscription.TenantId `
-DefaultProfile $AzureContext
$user = "MyDomain\MyUser"
$pw = ConvertTo-SecureString "PassWord!" -AsPlainText -Force
$cred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $user, $pw
New-AzureAutomationCredential -AutomationAccountName "MyAutomationAccount" -Name "MyCredential" -Value $cred
$myCredential = Get-AutomationPSCredential -Name 'MyCredential'
$userName = $myCredential.UserName
$securePassword = $myCredential.Password
$password = $myCredential.GetNetworkCredential().Password
# 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
# Get credential
$myCred = Get-AutomationPSCredential -Name "MyCredential"
$userName = $myCred.UserName
$securePassword = $myCred.Password
$password = $myCred.GetNetworkCredential().Password
$myPsCred = New-Object System.Management.Automation.PSCredential ($userName,$securePassword)
# Connect to Azure with credential
$AzureContext = (Connect-AzAccount -Credential $myPsCred -TenantId $AzureContext.Subscription.TenantId).context
# set and store context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription `
-TenantId $AzureContext.Subscription.TenantId `
-DefaultProfile $AzureContext