Skip to content

Commit 407012d

Browse files
Content update
1 parent c9d7d6e commit 407012d

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

articles/automation/automation-child-runbooks.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ The parameters of a child runbook called inline can be of any data type, includi
4242
Currently, PowerShell 5.1 is supported and only certain runbook types can call each other:
4343

4444
* A [PowerShell runbook](automation-runbook-types.md#powershell-runbooks) and a [graphical runbook](automation-runbook-types.md#graphical-runbooks) can call each other inline, because both are PowerShell based.
45-
* A [PowerShell Workflow runbook](automation-runbook-types.md#powershell-workflow-runbooks) and a graphical PowerShell Workflow runbook can call each other inline, because both are PowerShell Workflow based.
45+
* A [PowerShell Workflow runbook](automation-runbook-types.md#powershell-workflow-runbooks) can call another PowerShell Workflow runbook inline.
4646
* The PowerShell types and the PowerShell Workflow types can't call each other inline. They must use `Start-AzAutomationRunbook`.
4747

4848
> [!IMPORTANT]
49-
> Executing child scripts using `.\child-runbook.ps1` is not supported in PowerShell 7.1 and PowerShell 7.2
49+
> * Executing child scripts using `.\child-runbook.ps1` is not supported in PowerShell 7.1 and PowerShell 7.2
5050
**Workaround**: Use `Start-AutomationRunbook` ([internal cmdlet](/azure/automation/shared-resources/modules#internal-cmdlets)) or `Start-AzAutomationRunbook` (from [Az.Automation module](/powershell/module/Az.Automation/Start-AzAutomationRunbook)) to start another runbook from parent runbook.
5151

52-
The publish order of runbooks matters only for PowerShell Workflow and graphical PowerShell Workflow runbooks.
52+
> * Executing child scripts using Graphical PowerShell Workflow runbooks is not supported.
53+
**Workaround**: Use Start-AzAutomationRunbook (from [Az.Automation module](/powershell/module/Az.Automation/Start-AzAutomationRunbook)) from within the parent runbook (via an InlineScript block) to start another runbook.
5354

54-
When your runbook calls a graphical or PowerShell Workflow child runbook by using inline execution, it uses the name of the runbook. The name must start with `.\\` to specify that the script is in the local directory.
55+
The publish order of runbooks matters only for PowerShell Workflow runbooks.
56+
57+
When your runbook calls a PowerShell Workflow child runbook by using inline execution, it uses the name of the runbook. The name must start with `.\\` to specify that the script is in the local directory.
5558

5659
### Example
5760

articles/automation/troubleshoot/runbooks.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,39 @@ ms.custom: has-adal-ref, devx-track-azurepowershell
1111

1212
This article describes runbook issues that might occur and how to resolve them. For general information, see [Runbook execution in Azure Automation](../automation-runbook-execution.md).
1313

14+
## Graphical PowerShell Workflow runbooks with child runbooks fail to execute
15+
16+
### Issue
17+
Graphical PowerShell Workflow runbooks with child runbooks fail to execute as expected.
18+
19+
### Cause
20+
To improve the security posture of Graphical PowerShell Workflow runbooks, the service no longer executes Graphical PowerShell Workflow runbooks with child scripts.
21+
22+
### Resolution
23+
24+
Workaround is to use Start-AzAutomationRunbook (from [Az.Automation module](/powershell/module/Az.Automation/Start-AzAutomationRunbook)) from within the parent runbook to start child runbook. For example, use the InlineScript block:
25+
26+
27+
28+
$job = Start-AzAutomationRunbook `
29+
30+
-AutomationAccountName "MyAccount" `
31+
32+
-ResourceGroupName "MyRG" `
33+
34+
-Name "ReusableTaskRunbook" `
35+
36+
-Parameters @{ TaskId = '1234' }
37+
38+
39+
40+
#Optional: Wait for job completion
41+
42+
do {
43+
44+
Start-Sleep -Seconds 5
45+
46+
$jobStatus = Get-AzAutomationJob -Id $job.Id -AutomationAccountName "MyAccount" -ResourceGroupName "MyRG"} while ($jobStatus.Status -ne "Completed")
1447

1548
## It is no longer possible to use cmdlets from imported non-default modules in graphical PowerShell runbooks
1649

0 commit comments

Comments
 (0)