|
| 1 | +--- |
| 2 | +title: Runbook jobs get suspended in Azure Automation |
| 3 | +description: Provides solutions to an issue where runbook jobs get suspended in Azure Automation. |
| 4 | +ms.date: 06/17/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 get suspended in Azure Automation |
| 10 | + |
| 11 | +This article provides solutions to an issue where runbook jobs get suspended in Azure Automation. |
| 12 | + |
| 13 | +> [!NOTE] |
| 14 | +> Azure Automation enables recovery of runbooks deleted in last 29 days - Restore the deleted runbook by running a PowerShell script as a job in your Automation account. For more information, see [Restore deleted runbook](https://learn.microsoft.com/azure/automation/manage-runbooks#restore-deleted-runbook). |
| 15 | +
|
| 16 | +## Symptoms |
| 17 | + |
| 18 | +Runbook jobs might be in a suspended state after three failed start attempts. |
| 19 | + |
| 20 | +## Cause 1: Exceed memory or network socket limits in an Azure sandbox |
| 21 | + |
| 22 | +- Memory limit |
| 23 | + |
| 24 | + A job might fail if using more than 400 MB of memory. |
| 25 | +- Network socket limit |
| 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 to work within the 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 out variables. |
| 41 | +- Use the `[GC]::Collect` command to run the garbage collection immediately. |
| 42 | + |
| 43 | +## Cause 2: Module incompatibility |
| 44 | + |
| 45 | +Module dependencies might not be correct. 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: No authentication with Microsoft Entra ID in an Azure sandbox |
| 50 | + |
| 51 | +Azure Automation runbooks that attempt to call executables or subprocesses within the Azure sandbox environment can't use Microsoft Authentication Library (MSAL) for authentication with Microsoft Entra ID. |
| 52 | + |
| 53 | +To resolve this issue, use Managed Identity for the Automation account. When you authenticate this runbook with Microsoft Entra ID by using Managed Identity, ensure the following things: |
| 54 | + |
| 55 | +- The Azure AD PowerShell module is available in your Automation account. |
| 56 | +- The Managed Identity is granted the required permissions to execute the tasks automated by the runbook. |
| 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 limited by the memory and network limits that Azure sandboxes have. |
| 59 | + |
| 60 | +## References |
| 61 | + |
| 62 | +- [Throttling Azure Resource Manager requests](https://learn.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling) |
| 63 | +- [Troubleshooting API throttling errors](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshooting-throttling-errors) |
| 64 | + |
| 65 | +[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)] |
0 commit comments