Skip to content

Commit ff55791

Browse files
committed
Fixing task 1665808
1 parent 70d596d commit ff55791

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

articles/automation/troubleshoot/runbooks.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ manager: carmonm
1212

1313
# Troubleshoot errors with runbooks
1414

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.
1616

1717
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.
1818

@@ -24,15 +24,15 @@ When you have errors executing runbooks in Azure Automation, you can use the fol
2424

2525
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.
2626

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).
2828

2929
If your Runbook is suspended or unexpectedly failed:
3030

3131
* [Check Job Statuses](https://docs.microsoft.com/azure/automation/automation-runbook-execution#job-statuses) defines runbook statuses and some possible causes.
3232
* [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.
3333
* [Handle any exceptions](https://docs.microsoft.com/azure/automation/automation-runbook-execution#handling-exceptions) that are thrown by your job.
3434

35-
## <a name="login-azurerm"></a>Scenario: Run Login-AzureRMAccount to login
35+
## <a name="login-azurerm"></a>Scenario: Run Login-AzureRMAccount to log in
3636

3737
### Issue
3838

@@ -49,15 +49,15 @@ This error can occur when you are not using a RunAs account or the RunAs account
4949
This error has two primary causes:
5050

5151
* 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.
5353

5454
### Resolution
5555

5656
If you receive this error after updating one AzureRM module, you should update all of your AzureRM modules to the same version.
5757

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.
5959

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.
6161
![Copy Application ID and Thumbprint](../media/troubleshoot-runbooks/collect-app-id.png)
6262
1. Go to the subscription's Access Control where the Automation Account is NOT hosted, and add a new role assignment.
6363
![Access control](../media/troubleshoot-runbooks/access-control.png)
@@ -137,7 +137,7 @@ If you have multi-factor authentication on your Azure account, you can't use an
137137

138138
### Resolution
139139

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).
141141

142142
## <a name="get-serializationsettings"></a>Scenario: You see an error in your job streams about the get_SerializationSettings Method
143143

@@ -163,7 +163,7 @@ This error is caused by using both AzureRM and Az cmdlets in a runbook. It occur
163163

164164
### Resolution
165165

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).
167167

168168
## <a name="task-was-cancelled"></a>Scenario: The runbook fails with the error: A task was canceled
169169

@@ -263,31 +263,29 @@ The job was tried three times but it failed
263263

264264
### Cause
265265

266-
This error occurs due to one of the following issues:
266+
This error occurs due to one of the following issues.
267267

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.
269269

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).
271271

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.
273273

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.
275275

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.
277277

278278
### Resolution
279279

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.
283281

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).
285283

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.
287285

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.
289287

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.
291289

292290
## <a name="sign-in-failed"></a>Scenario: Sign in to Azure Account failed
293291

@@ -360,11 +358,11 @@ Object reference not set to an instance of an object
360358

361359
### Cause
362360

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.
364362

365363
### Resolution
366364

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.
368366

369367
```powershell
370368
$automationAccountName = "ContosoAutomationAccount"
@@ -472,13 +470,13 @@ This behavior is by design in Azure sandboxes because of the "Fair Share" monito
472470

473471
### Cause
474472

475-
The runbook ran over the 3 hour 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.
476474

477475
### Resolution
478476

479477
One recommended solution is to run the runbook on a [Hybrid Runbook Worker](../automation-hrw-run-runbooks.md).
480478

481-
Hybrid Workers aren't limited by the [fair share](../automation-runbook-execution.md#fair-share) 3 hour 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.
482480

483481
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.
484482

@@ -506,7 +504,7 @@ The webhook that you're trying to call is either disabled or is expired.
506504

507505
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.
508506

509-
## <a name="429"></a>Scenario: 429: The request rate is currently too large. Please try again
507+
## <a name="429"></a>Scenario: 429: The request rate is currently too large...
510508

511509
### Issue
512510

@@ -539,7 +537,7 @@ Exception was thrown - Cannot invoke method. Method invocation is supported only
539537

540538
### Cause
541539

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).
543541

544542
### Resolution
545543

@@ -569,7 +567,7 @@ RunAs accounts may not have the same permissions against Azure resources as your
569567

570568
## Issues Passing parameters into webhooks
571569

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).
573571

574572
## Issues Using Az modules
575573

@@ -585,20 +583,20 @@ RunAs accounts may not have the same permissions against Azure resources as your
585583

586584
## Runbooks were working, but suddenly stopped
587585

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).
589587
* If you are using webhooks to start runbooks, ensure the webhook [has not expired](https://docs.microsoft.com/azure/automation/automation-webhooks#renew-webhook).
590588

591589
## Passing parameters into webhooks
592590

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).
594592

595593
## Using Az modules
596594

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).
598596

599597
## Using Self-Signed Certificates
600598

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).
602600

603601
## Recommended Documents
604602

0 commit comments

Comments
 (0)