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:
β οΈ
windows_first
β οΈ
powershell_heavy
β οΈ
windows_tools
β οΈ
missing_linux_example
Summary:
The documentation exhibits a Windows and PowerShell-centric bias. PowerShell (including Windows PowerShell and PowerShell Workflow) is presented first and in the most detail, with numerous examples and troubleshooting sections focused on Windows paths, environment variables, and cmdlets. Many examples and limitations reference Windows-specific file paths (e.g., C:\modules), environment variables, and tools, with little or no equivalent Linux guidance. Python runbooks are discussed, but Linux-specific instructions are minimal and often secondary to Windows explanations. Graphical runbooks and workflows are also tightly coupled to Windows PowerShell, and Linux support is explicitly limited or absent.
Recommendations:
- Provide Linux-specific examples and troubleshooting guidance alongside or before Windows examples, especially for file paths, environment variables, and known issues.
- When referencing environment variables or file paths, include both Windows and Linux formats (e.g., C:\modules and /opt/automation/modules).
- Clarify which features and limitations apply to Linux Hybrid Runbook Workers, and offer Linux workarounds where possible.
- For PowerShell runbooks, explicitly document differences in behavior or support between Windows and Linux Hybrid Runbook Workers.
- Expand Python runbook sections to include more Linux-specific details, such as package management, file system paths, and common issues.
- Where graphical runbooks or workflows are Windows-only, suggest alternative approaches for Linux users or clearly state the lack of support.
- Balance the order of presentation so that Linux and cross-platform scenarios are not always secondary to Windows.
Create pull request
Flagged Code Snippets
# [PowerShell 7.1](#tab/lps71)
**Limitations**
- [PowerShell 7.1](/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.3&preserve-view=true#powershell-end-of-support-dates) is no longer supported by parent product PowerShell. We recommend that you create new runbooks in PowerShell 7.4 for a long term support and update the outdated runbooks.
- The Azure Automation internal PowerShell cmdlets aren't supported on a Linux Hybrid Runbook Worker. You must import the `automationassets` module at the beginning of your PowerShell runbook to access the Automation account shared resources (assets) functions.
- For the PowerShell 7 runtime version, the module activities aren't extracted for the imported modules.
- *PSCredential* runbook parameter type isn't supported in PowerShell 7 runtime version.
- PowerShell 7.x doesn't support workflows. For more information, see [PowerShell Workflow](/powershell/scripting/whats-new/differences-from-windows-powershell#powershell-workflow) for more details.
- PowerShell 7.x currently doesn't support signed runbooks.
- Source control integration doesn't support PowerShell 7.1 (preview) Also, PowerShell 7.1 (preview) runbooks in source control gets created in Automation account as Runtime 5.1.
- PowerShell 7.1 module management isn't supported through `Get-AzAutomationModule` cmdlets.
- Runbook fails with no log trace if the input value contains the character '.
- Azure runbook doesn't support `Start-Job` with `-credential`.
- Azure doesn't support all PowerShell input parameters. [Learn more](runbook-input-parameters.md).
**Known issues**
- Runbooks taking dependency on internal file paths such as `C:\modules` might fail due to changes in service backend infrastructure. Change runbook code to ensure there are no dependencies on internal file paths and use [Get-ChildItem](/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.3&preserve-view=true) to get the required module information.
**Sample script**
- Avoid importing `Az.Accounts` module to version 2.4.0 for PowerShell 7 runtime as there can be an unexpected behavior using this version in Azure Automation.
- You might encounter formatting problems with error output streams for the job running in PowerShell 7 runtime.
- When you import a PowerShell 7.1 module that's dependent on other modules, you may find that the import button is gray even when PowerShell 7.1 version of the dependent module is installed. For example, Az PowerShell module.Compute version 4.20.0, has a dependency on Az.Accounts being >= 2.6.0. This issue occurs when an equivalent dependent module in PowerShell 5.1 doesn't meet the version requirements. For example, 5.1 version of Az.Accounts were < 2.6.0.
- When you start PowerShell 7 runbook using the webhook, it auto-converts the webhook input parameter to an invalid JSON.
- We recommend that you use [ExchangeOnlineManagement](/powershell/exchange/exchange-online-powershell?view=exchange-ps&preserve-view=true) module version: 3.0.0 or lower because version: 3.0.0 or higher may lead to job failures.
- If you import module Az.Accounts with version 2.12.3 or newer, ensure that you import the **Newtonsoft.Json** v10 module explicitly if PowerShell 7.1 runbooks have a dependency on this version of the module. The workaround for this issue is to use PowerShell 7.2 runbooks.
- When you utilize theβ―`New-AzAutomationVariable`β― cmdlet within Az.Automation Module to upload a variable of type **object**, the operation doesn't function as expected.
**Workaround**: Convert the object to a JSON string using theβ―ConvertTo-Jsonβ―cmdlet and then upload the variable with the JSON string as its value. This workaround ensures proper handling of the variable within the Azure Automation environment as a JSON string.
**Example**β―- Create a PowerShell object that has stored information around Azure VMs
azurepowershell
# Retrieve Azure virtual machines with status information for the 'northeurope' region
$AzVM = Get-AzVM -Status | Where-Object {$_.Location -eq "northeurope"}
$VMstopatch = @($AzVM).Id
# Create an Azure Automation variable (This cmdlet will not fail, but the variable may not work as intended when used in the runbook.)
New-AzAutomationVariable -ResourceGroupName "mrg" -AutomationAccountName "mAutomationAccount2" -Name "complex1" -Encrypted $false -Value $VMstopatch
# Convert the object to a JSON string
$jsonString = $VMstopatch | ConvertTo-Json
# Create an Azure Automation variable with a JSON string value (works effectively within the automation runbook)
New-AzAutomationVariable -ResourceGroupName "mrg" -AutomationAccountName "mAutomationAccount2" -Name "complex1" -Encrypted $false -Value $jsonString
- `Get-AzStorageAccount` cmdlet might fail with an error: *The `Get-AzStorageAccount` command was found in the module `Az.Storage`, but the module could not be loaded*.
- Executing child scripts using `.\child-runbook.ps1` isn't supported in this preview.
**Workaround**: Use `Start-AutomationRunbook` (internal cmdlet) or `Start-AzAutomationRunbook` (from `Az.Automation` module) to start another runbook from parent runbook.
- Runbook properties defining logging preference isn't supported in PowerShell 7 runtime.
**Workaround**: Explicitly set the preference at the start of the runbook as following: