-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start-AzAutomationRunbook swallows error returned from service #19823
Comments
I managed to get it to work using this code: $adminCredential = Get-AutomationPSCredential -Name '[email protected]' $azureContext = Set-AzContext -Tenant -Subscription Start-AzAutomationRunbook -AutomationAccountName "XXX" -Name "ChildToCallFromParent" -ResourceGroupName "YYY" -DefaultProfile $azureContext -RunOn "DEV-HYB-WORKERS" -Wait -Parameters @{"userDataDiffs"="testString"} |
@robpukdf , Azure PowerShell establishes multiple contexts if user can access to multiple subscriptions. According to your script and error, it seems target automation account is not in default subscription. You need to either switch context using The error message is client side problem. I believe service returns 404 error. It should not be swallowed. I include owner team to fix it. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaspkaur28. Issue DetailsDescriptionI am trying to call an Azure Automation Hybrid Worker Runbook from another Azure Automation Runbook, but I keep receiving a null reference error. To start, I was just trying to call one Runbook from another: Parent: Start-AzAutomationRunbook -AutomationAccountName "XXX" -Name "ChildToCallFromParent" -ResourceGroupName "YYY" -Parameters @{"userDataDiffs"="testString"} Child: param ( Write-Output $userDataDiffs Output: Start-AzAutomationRunbook : Object reference not set to an instance of an object. At line:29 char:1 + Start-AzAutomationRunbook -AutomationAccountName "XXX" ... + Anyone have any guidance on this please? Script or Debug outputNo response Environment dataNo response Module versionsNo response Error outputNo response
|
Description
I am trying to call an Azure Automation Hybrid Worker Runbook from another Azure Automation Runbook, but I keep receiving a null reference error. To start, I was just trying to call one Runbook from another:
Parent:
Start-AzAutomationRunbook -AutomationAccountName "XXX" -Name "ChildToCallFromParent" -ResourceGroupName "YYY" -Parameters @{"userDataDiffs"="testString"}
Child:
param (
[string] $userDataDiffs
)
Write-Output $userDataDiffs
Output:
Start-AzAutomationRunbook : Object reference not set to an instance of an object. At line:29 char:1 + Start-AzAutomationRunbook -AutomationAccountName "XXX" ... +
Anyone have any guidance on this please?
Script or Debug output
No response
Environment data
No response
Module versions
No response
Error output
No response
The text was updated successfully, but these errors were encountered: