You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/automation/troubleshoot/runbooks.md
+30-32Lines changed: 30 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ manager: carmonm
12
12
13
13
# Troubleshoot errors with runbooks
14
14
15
-
When you have errors executing runbooks in Azure Automation, you can use the following steps to help diagnose the issue.
15
+
When you have errors executing runbooks in Azure Automation, you can use the following steps to help diagnose the issues.
16
16
17
17
1.**Ensure your runbook script executes successfully on your local machine:** Refer to the [PowerShell Docs](/powershell/scripting/overview) or [Python Docs](https://docs.python.org/3/) for language reference and learning modules.
18
18
@@ -24,15 +24,15 @@ When you have errors executing runbooks in Azure Automation, you can use the fol
24
24
25
25
2.**Investigate runbook**[error streams](https://docs.microsoft.com/azure/automation/automation-runbook-output-and-messages#runbook-output) for specific messages and compare them to the errors below.
26
26
27
-
3.**Ensure your Nodes and Automation workspace have the required modules:** If your runbook imports any modules, ensure they are available into your automation account using the steps listed in [Import Modules](../shared-resources/modules.md#import-modules). Update your modules to the latest version by following the instructions under[Update Azure modules in Azure Automation](..//automation-update-azure-modules.md). For more troubleshooting information, see [Troubleshoot Modules](shared-resources.md#modules).
27
+
3.**Ensure your Nodes and Automation workspace have the required modules:** If your runbook imports any modules, ensure they are available to your Automation account using the steps listed in [Import Modules](../shared-resources/modules.md#import-modules). Update your modules to the latest version by following the instructions at[Update Azure modules in Azure Automation](..//automation-update-azure-modules.md). For more troubleshooting information, see [Troubleshoot Modules](shared-resources.md#modules).
28
28
29
29
If your Runbook is suspended or unexpectedly failed:
30
30
31
31
*[Check Job Statuses](https://docs.microsoft.com/azure/automation/automation-runbook-execution#job-statuses) defines runbook statuses and some possible causes.
32
32
*[Add additional output](https://docs.microsoft.com/azure/automation/automation-runbook-output-and-messages#message-streams) to the runbook to identify what happens before the runbook is suspended.
33
33
*[Handle any exceptions](https://docs.microsoft.com/azure/automation/automation-runbook-execution#handling-exceptions) that are thrown by your job.
34
34
35
-
## <aname="login-azurerm"></a>Scenario: Run Login-AzureRMAccount to login
35
+
## <aname="login-azurerm"></a>Scenario: Run Login-AzureRMAccount to log in
36
36
37
37
### Issue
38
38
@@ -49,15 +49,15 @@ This error can occur when you are not using a RunAs account or the RunAs account
49
49
This error has two primary causes:
50
50
51
51
* Different versions of AzureRM modules.
52
-
* You are trying to access resources in a separate subscription.
52
+
* You're trying to access resources in a separate subscription.
53
53
54
54
### Resolution
55
55
56
56
If you receive this error after updating one AzureRM module, you should update all of your AzureRM modules to the same version.
57
57
58
-
If you are trying to access resources in another subscription, you can follow the steps below to configure permissions.
58
+
If you're trying to access resources in another subscription, you can follow the steps below to configure permissions.
59
59
60
-
1. Go to the Automation Account's run as account and copy the Application ID and thumbprint.
60
+
1. Go to the Automation RunAs account and copy the Application ID and thumbprint.
61
61

62
62
1. Go to the subscription's Access Control where the Automation Account is NOT hosted, and add a new role assignment.
@@ -137,7 +137,7 @@ If you have multi-factor authentication on your Azure account, you can't use an
137
137
138
138
### Resolution
139
139
140
-
To use a certificate with the Azure classic deployment model cmdlets, refer to [creating and adding a certificate to manage Azure services.](https://blogs.technet.com/b/orchestrator/archive/2014/04/11/managing-azure-services-with-the-microsoft-azure-automation-preview-service.aspx) To use a service principal with Azure Resource Manager cmdlets, refer to [creating service principal using Azure portal](../../active-directory/develop/howto-create-service-principal-portal.md) and [authenticating a service principal with Azure Resource Manager.](../../active-directory/develop/howto-authenticate-service-principal-powershell.md)
140
+
To use a certificate with the Azure classic deployment model cmdlets, refer to [creating and adding a certificate to manage Azure services](https://blogs.technet.com/b/orchestrator/archive/2014/04/11/managing-azure-services-with-the-microsoft-azure-automation-preview-service.aspx). To use a service principal with Azure Resource Manager cmdlets, refer to [creating service principal using Azure portal](../../active-directory/develop/howto-create-service-principal-portal.md) and [authenticating a service principal with Azure Resource Manager](../../active-directory/develop/howto-authenticate-service-principal-powershell.md).
141
141
142
142
## <aname="get-serializationsettings"></a>Scenario: You see an error in your job streams about the get_SerializationSettings Method
143
143
@@ -163,7 +163,7 @@ This error is caused by using both AzureRM and Az cmdlets in a runbook. It occur
163
163
164
164
### Resolution
165
165
166
-
Az and AzureRM cmdlets can not be imported and used in the same runbook, to learn more about Az support in Azure Automation, see [Az module support in Azure Automation](../az-modules.md).
166
+
Az and AzureRM cmdlets can't be imported and used in the same runbook. To learn more about Az cmdlets in Azure Automation, see [Az module support in Azure Automation](../az-modules.md).
167
167
168
168
## <aname="task-was-cancelled"></a>Scenario: The runbook fails with the error: A task was canceled
169
169
@@ -263,31 +263,29 @@ The job was tried three times but it failed
263
263
264
264
### Cause
265
265
266
-
This error occurs due to one of the following issues:
266
+
This error occurs due to one of the following issues.
267
267
268
-
* Memory Limit. The documented limits on how much memory is allocated to a Sandbox is found at [Automation service limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#automation-limits). A job may fail it if it's using more than 400 MB of memory.
268
+
* Memory Limit. The documented limits on memory allocated to a sandbox are found at [Automation service limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#automation-limits). A job may fail if it's using more than 400 MB of memory.
269
269
270
-
* Network Sockets. Azure sandboxes are limited to 1000 concurrent network sockets as described at[Automation service limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#automation-limits).
270
+
* Network Sockets. Azure sandboxes are limited to 1000 concurrent network sockets. See[Automation service limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#automation-limits).
271
271
272
-
* Module Incompatible. This error can occur if module dependencies aren't correct and if they aren't, your runbook typically returns a "Command not found" or "Cannot bind parameter" message.
272
+
* Module Incompatible. Module dependencies might not be correct. In this case, your runbook typically returns a "Command not found" or "Cannot bind parameter" message.
273
273
274
-
* Your runbook attempted to call an executable or subprocess in a runbook that runs in an Azure sandbox. This scenario is not supported in Azure sandboxes.
274
+
*No Authentication with Active Directory for Sandbox. Your runbook attempted to call an executable or subprocess that runs in an Azure sandbox. Configuring runbooks to authenticate with Azure AD using the Azure Active Directory Authentication Library (ADAL) is not supported.
275
275
276
-
* Your runbook attempted to write too much exception data to the output stream.
276
+
*Too Much Exception Data. Your runbook attempted to write too much exception data to the output stream.
277
277
278
278
### Resolution
279
279
280
-
Any of the following solutions fix the problem:
281
-
282
-
* Suggested methods to work within the memory limit are to split the workload between multiple runbooks, not process as much data in memory, not to write unnecessary output from your runbooks, or consider how many checkpoints you write into your PowerShell Workflow runbooks. You can use the clear method, such as `$myVar.clear()` to clear out the variable and use `[GC]::Collect()` to run garbage collection immediately. These actions reduce the memory footprint of your runbook during runtime.
280
+
* Memory Limit, Network Sockets. Suggested ways work within the memory limit are to split the workload among multiple runbooks, process less data in memory, avoid writing unnecessary output from your runbooks, and consider how many checkpoints are written into your PowerShell Workflow runbooks. You can use the clear method, such as `$myVar.clear`, to clear out variables and use `[GC]::Collect` to run garbage collection immediately. These actions reduce the memory footprint of your runbook during runtime.
283
281
284
-
* Update your Azure modules by following the steps [How to update Azure PowerShell modules in Azure Automation](../automation-update-azure-modules.md).
282
+
*Module Incompatible. Update your Azure modules by following the steps in[How to update Azure PowerShell modules in Azure Automation](../automation-update-azure-modules.md).
285
283
286
-
*Another solution is to run the runbook on a [Hybrid Runbook Worker](../automation-hrw-run-runbooks.md). Hybrid Workers aren't limited by the memory and network limits that Azure sandboxes are.
284
+
*No Authentication with ADAL for Sandbox. When authenticating to Azure AD with a runbook, ensure that the Azure AD module is available in your Automation account. Be sure to grant the Automation RunAs account the necessary permissions to perform the tasks that the runbook automates.
287
285
288
-
*If you need to call a process (such as .exe or subprocess.call) in a runbook, you'll need to run the runbook on a [Hybrid Runbook Worker](../automation-hrw-run-runbooks.md).
286
+
If your runbook can't call an executable or subprocess running in an Azure sandbox, use the runbook on a [Hybrid Runbook Worker](../automation-hrw-run-runbooks.md). Hybrid workers aren't limited by the memory and network limits that Azure sandboxes have.
289
287
290
-
* There is a 1MB limit on the job output stream. Ensure that you enclose calls to an executable or subprocess in a try/catch block. If they throw an exception, write the message from that exception into an Automation variable. This will prevent it from being written into the job output stream.
288
+
*Too Much Exception Data. There is a 1-MB limit on the job output stream. Ensure that your runbook encloses calls to an executable or subprocess in a try/catch block. If the operations throw an exception, have the code write the message from the exception into an Automation variable. This technique prevents the message from being written into the job output stream.
291
289
292
290
## <aname="sign-in-failed"></a>Scenario: Sign in to Azure Account failed
293
291
@@ -360,11 +358,11 @@ Object reference not set to an instance of an object
360
358
361
359
### Cause
362
360
363
-
There is a known issue where the [Start-AzureRmAutomationRunbook](/powershell/module/AzureRM.Automation/Start-AzureRmAutomationRunbook) does not handle the output stream correctly if it contains objects.
361
+
There is a known issue where the Start-AzureRmAutomationRunbook does not handles the output stream correctly if it contains objects.
364
362
365
363
### Resolution
366
364
367
-
To resolve this it is recommended that you instead implement a polling logic and use the [Get-AzureRmAutomationJobOutput](/powershell/module/azurerm.automation/get-azurermautomationjoboutput) cmdlet to retrieve the output. A sample of this logic is defined in the following example.
365
+
To resolve this issue, it is recommended that you implement a polling logic and use the [Get-AzureRmAutomationJobOutput](/powershell/module/azurerm.automation/get-azurermautomationjoboutput) cmdlet to retrieve the output. A sample of this logic is defined in the following example.
@@ -472,13 +470,13 @@ This behavior is by design in Azure sandboxes because of the "Fair Share" monito
472
470
473
471
### Cause
474
472
475
-
The runbook ran over the 3hour limit allowed by fair share in an Azure Sandbox.
473
+
The runbook ran over the 3-hour limit allowed by Fair Share in an Azure Sandbox.
476
474
477
475
### Resolution
478
476
479
477
One recommended solution is to run the runbook on a [Hybrid Runbook Worker](../automation-hrw-run-runbooks.md).
480
478
481
-
Hybrid Workers aren't limited by the [fair share](../automation-runbook-execution.md#fair-share) 3hour runbook limit that Azure sandboxes are. Runbooks ran on Hybrid Runbook Workers should be developed to support restart behaviors if there are unexpected local infrastructure issues.
479
+
Hybrid Workers aren't limited by the [Fair Share](../automation-runbook-execution.md#fair-share) 3-hour runbook limit that Azure sandboxes have. Runbooks run on Hybrid Runbook Workers should be developed to support restart behaviors if there are unexpected local infrastructure issues.
482
480
483
481
Another option is to optimize the runbook by creating [child runbooks](../automation-child-runbooks.md). If your runbook loops through the same function on several resources, such as a database operation on several databases, you can move that function to a child runbook. Each of these child runbooks executes in parallel in separate processes. This behavior decreases the total amount of time for the parent runbook to complete.
484
482
@@ -506,7 +504,7 @@ The webhook that you're trying to call is either disabled or is expired.
506
504
507
505
If the webhook is disabled, you can re-enable the webhook through the Azure portal. when a webhook is expired, the webhook needs to be deleted and recreated. You can only [renew a webhook](../automation-webhooks.md#renew-webhook) if it hasn't already expired.
508
506
509
-
## <aname="429"></a>Scenario: 429: The request rate is currently too large. Please try again
507
+
## <aname="429"></a>Scenario: 429: The request rate is currently too large...
510
508
511
509
### Issue
512
510
@@ -539,7 +537,7 @@ Exception was thrown - Cannot invoke method. Method invocation is supported only
539
537
540
538
### Cause
541
539
542
-
This error may occur when you start a PowerShell job in a runbook ran in Azure. This behavior may occur because runbooks ran in an Azure sandbox may not run in the [Full language mode](/powershell/module/microsoft.powershell.core/about/about_language_modes)).
540
+
This error may occur when you start a PowerShell job in a runbook that runs in Azure. This behavior may occur because runbooks run in an Azure sandbox may not run in the [Full language mode](/powershell/module/microsoft.powershell.core/about/about_language_modes).
543
541
544
542
### Resolution
545
543
@@ -569,7 +567,7 @@ RunAs accounts may not have the same permissions against Azure resources as your
569
567
570
568
## Issues Passing parameters into webhooks
571
569
572
-
For help passing parameters into webhooks, see [Start a runbook from a webhook](https://docs.microsoft.com/azure/automation/automation-webhooks#parameters).
570
+
For help with passing parameters into webhooks, see [Start a runbook from a webhook](https://docs.microsoft.com/azure/automation/automation-webhooks#parameters).
573
571
574
572
## Issues Using Az modules
575
573
@@ -585,20 +583,20 @@ RunAs accounts may not have the same permissions against Azure resources as your
585
583
586
584
## Runbooks were working, but suddenly stopped
587
585
588
-
* If runbooks were previously executing but stopped, ensure the RunAs account [has not expired](https://docs.microsoft.com/azure/automation/manage-runas-account#cert-renewal).
586
+
* If runbooks were previously executing but stopped, ensure that the RunAs account [has not expired](https://docs.microsoft.com/azure/automation/manage-runas-account#cert-renewal).
589
587
* If you are using webhooks to start runbooks, ensure the webhook [has not expired](https://docs.microsoft.com/azure/automation/automation-webhooks#renew-webhook).
590
588
591
589
## Passing parameters into webhooks
592
590
593
-
For help passing parameters into webhooks, see [Start a runbook from a webhook](https://docs.microsoft.com/azure/automation/automation-webhooks#parameters).
591
+
For help with passing parameters into webhooks, see [Start a runbook from a webhook](https://docs.microsoft.com/azure/automation/automation-webhooks#parameters).
594
592
595
593
## Using Az modules
596
594
597
-
Using Az modules and AzureRM modules in the same Automation Account is not supported. Please see [Az modules in runbooks](https://docs.microsoft.com/azure/automation/az-modules) for more details.
595
+
Using Az modules and AzureRM modules in the same Automation Account is not supported. See [Az modules in runbooks](https://docs.microsoft.com/azure/automation/az-modules).
598
596
599
597
## Using Self-Signed Certificates
600
598
601
-
To use Self-Signed certificates you must follow the guide at[Creating a New Certificate](https://docs.microsoft.com/azure/automation/shared-resources/certificates#creating-a-new-certificate).
599
+
To use Self-Signed certificates, see[Creating a New Certificate](https://docs.microsoft.com/azure/automation/shared-resources/certificates#creating-a-new-certificate).
0 commit comments