|
| 1 | +--- |
| 2 | +title: Runbook Jobs Get Suspended in Azure Automation |
| 3 | +description: Provides solutions to an issue where runbook jobs are suspended in Azure Automation. |
| 4 | +ms.date: 06/24/2025 |
| 5 | +ms.reviewer: adoyle, v-weizhu |
| 6 | +ms.service: azure-automation |
| 7 | +ms.custom: sap:Runbook not working as expected |
| 8 | +--- |
| 9 | +# Runbook jobs are suspended in Azure Automation |
| 10 | + |
| 11 | +This article provides solutions to an issue where runbook jobs are suspended in Azure Automation. |
| 12 | + |
| 13 | +> [!NOTE] |
| 14 | +> Azure Automation enables recovery of runbooks deleted in the last 29 days. You can restore the deleted runbook by running a PowerShell script as a job in your Automation account. For more information, see [Restore a deleted runbook](/azure/automation/manage-runbooks#restore-deleted-runbook). |
| 15 | +
|
| 16 | +## Symptoms |
| 17 | + |
| 18 | +Runbook jobs might be suspended after three failed start attempts. |
| 19 | + |
| 20 | +## Cause 1: Exceeding memory or network socket limits in an Azure sandbox |
| 21 | + |
| 22 | +- Memory limits |
| 23 | + |
| 24 | + A job might fail if it uses more than 400 MB of memory. |
| 25 | +- Network socket limits |
| 26 | + |
| 27 | + An Azure sandbox is limited to 1,000 concurrent network sockets. |
| 28 | + |
| 29 | +For more information, see [Azure Automation limits](/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-automation-limits). |
| 30 | + |
| 31 | +Here are some suggestions for working within memory limits: |
| 32 | + |
| 33 | +- Split the workload among multiple runbooks. |
| 34 | +- Reduce the amount of data processed in memory. |
| 35 | +- Avoid writing unnecessary output from your runbooks. |
| 36 | +- Consider the number of checkpoints written in your PowerShell workflow runbooks. |
| 37 | + |
| 38 | +Here are some actions that can reduce the memory footprint of your runbook during runtime: |
| 39 | + |
| 40 | +- Use the `clear` method, such as `$myVar.clear`, to clear variables. |
| 41 | +- Use the `[GC]::Collect` command to run the garbage collection immediately. |
| 42 | + |
| 43 | +## Cause 2: Module incompatibility |
| 44 | + |
| 45 | +Module dependencies might be incorrect. In this case, your runbook typically returns a "Command not found" or "Cannot bind parameter" error message. |
| 46 | + |
| 47 | +To resolve this issue, [update Azure PowerShell modules in Azure Automation](/azure/automation/automation-update-azure-modules). |
| 48 | + |
| 49 | +## Cause 3: Not authenticated with Microsoft Entra ID in an Azure sandbox |
| 50 | + |
| 51 | +Azure Automation runbooks that attempt to call executables or subprocesses within an Azure sandbox environment can't use Microsoft Authentication Library (MSAL) to authenticate with Microsoft Entra ID. |
| 52 | + |
| 53 | +To resolve this issue, use a managed identity for the Automation account. When you authenticate this runbook with Microsoft Entra ID by using a managed identity, ensure the following things: |
| 54 | + |
| 55 | +- The Microsoft Graph PowerShell module is available in your Automation account. |
| 56 | +- The managed identity is granted the permissions required to execute the runbook automation tasks. |
| 57 | + |
| 58 | +If your runbook can't call an executable or subprocess in an Azure sandbox, run the runbook on a [hybrid worker](/azure/automation/automation-hrw-run-runbooks). Hybrid workers aren't constrained by the memory and network limits of Azure sandboxes. |
| 59 | + |
| 60 | +## References |
| 61 | + |
| 62 | +- [Understand how Azure Resource Manager throttles requests](/azure/azure-resource-manager/management/request-limits-and-throttling) |
| 63 | +- [Troubleshooting API throttling errors](../../virtual-machines/windows/troubleshooting-throttling-errors.md) |
| 64 | + |
| 65 | +[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)] |
0 commit comments