How to execute PowerShell script as Azure Automation Runbook from InlineScript inside PSWorkflow runbook? -
in powershell workflow activity, can call native powershell script using inlinescript:
workflow test { inlinescript { .\script.ps1 } }
but in azure automation, dot-path (at least in tests) returning c:\windows\system32
, , script-as-runbook in azure automation did not exist there (or rather, failed execute because not find script).
- is possible execute native ps runbook stored in aauto this?
- if so, how specify path file?
- is bug/oversight in azure automation's parsing/compilation process of workflow runbooks & inlinescript activities, preventing dependent runbook being copied worker?
i did little hunting, , found when native ps runbooks executed:
- they first inspected other runbook references.
- as part of deployment worker execution, randomly-named folder created under
c:\temp\
- referenced runbooks copied folder.
- if runbooks not found referenced, not copied temp directory.
- the root runbook not appear copied folder.
- the dynamically-named folder not created (under c:\temp) when executing workflow runbook.
- as part of standard workflow compilation, inlinescript activities have contents copied autogenerated xaml. i'm uncertain linked file, though based on behavior looks runtime concern. guess compilation happens each time workflow executed (hence delayed start), , takes place on worker, utilizing standard ps workflow compilation local would.
i cannot (easily) convert script workflow, , used within other workflow activities. right way can make 'work' copy & paste script first inlinescript within workflow requires it, tedious & annoying maintenance perspective.
presumably, workaround, use hybrid worker, comes host of other issues, ensuring child runbooks published there & having maintain them separately, or aauto not automatically pushing custom modules automation account worker (though planned), etc.
please see https://azure.microsoft.com/en-us/blog/announcing-powershell-script-support-azure-automation-2/:
right now, can invoke inline powershell runbooks powershell runbooks, , powershell workflow or graph runbooks powershell workflow or graph runbooks. may change in future.
it hasn't changed yet :)
Comments
Post a Comment