Execute Native PowerShell Runbooks deployed to Azure Automation within a Workflow's InlineScript Activity
I created a StackOverflow question for this because I'm not sure if it's unsupported or if I'm doing it wrong (http://j.mp/23IaN2K).
But, assuming this is not supported, it would be a nice inclusion.
In my case, I have a native PS runbook which can't (easily, for now) be converted to workflow, but is required by other runbooks which have already been converted.
My workaround for now is to copy the contents of the dependent .ps1 as a function inside the (first) InlineScript activity in each workflow, which is obviously not ideal.
There error received is:
.\child.ps1 : The term '.\child.ps1' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At test:5 char:5
+ CategoryInfo : ObjectNotFound: (.\child.ps1:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Currently it is unsupported to call a PS script from a PS Workflow and vice-versa in Automation. What you can do right now is use Start-AzureRmAutomationRunbook to start runbooks of different type. This will asynchronously start a runbook.
joe brockhaus (rax) commented
We are moving to Workflows for native Parallelism as opposed to the Start+Poll methodology to achieve the same with more overhead and caveats (like input/output value serialization limits, etc).
In fact, the input/output serialization limitations are one reason why this runbook can't easily be converted to WF, and taking the time & effort implementing another way around that limitation and others isn't feasible.
Knowing about the available boilerplate utilities/templates (https://github.com/azureautomation/runbooks/tree/master/Utility) would have been helpful in the past, but like much of these old utilities, it looks like it would need to be re-written to support the ARM cmdlets & resources.
Start-AutomationChildRunbook (listed there) will start a new job and either poll until it's completed or return the job id.