0
votes

Problem statement: I have a powershell runbook that shuts down a VM on azure on a schedule.
I also have a sql runbook which checks a status in DB, now when the sql script has a result, I want to call the runbook for shutting down the VM depending on that result.

Question: Is it possible to integrate these two runbooks, Can I call a a workflow from a workflow?

2

2 Answers

1
votes

If those are 2 separate runbooks you would need to configure one of the runbooks with a webhook and add an action to the other runbook to invoke an http request against that webhook. That would be the easiest way.

Another way would be to merge those runbooks into one runbook and use powershell to create logic to shutdown VM based on your condition.

0
votes

Is it possible to integrate these two runbooks, Can I call a a workflow from a workflow?

Yes, it is possible. Azure Automation runbook supports call child runbook inside a runbook.

To expand on @4c74356b41 answer, you could use Start-AzureRmAutomationRunbook to call child runbook inside a runbook.

Start-AzureRmAutomationRunbook -AutomationAccountName "Contoso17" -Name "Runbk01" -ResourceGroupName "ResourceGroup01"

This command starts a runbook job for the runbook named Runbk01 in the Azure Automation account named Contoso17.

More information about Child runbooks in Azure Automation please refer to this link.