-
Resume or suspend a runbook
Resuming or suspending a runbook is closely related to checkpoints. You can manually suspend a workflow, which is typically done if some manual processing needs to be accomplished prior to running another set of activities. You can do this using the Azure Management Portal. A runbook can also be suspended by calling the activity Suspend-AzureAutomationJob, or it can call the Suspend-Workflow activity. This activity will set a checkpoint to cause the workflow to immediately suspend. At the next checkpoint, the job will be subsequently suspended. A possible scenario for this might be where you want to insert a Suspend-Workflow activity if there is a manual step that needs to be taken before a runbook can complete.
Suspension can also occur due to certain conditions. If a runbook unexpectedly crashes, the worker role on which it is running it can be suspended and will resume again from its last checkpoint. As mentioned previously, if an Azure Automation job runs for more than 30 minutes, it will be automatically suspended until given a chance to run again, resuming at the last checkpoint. A job can also unexpectedly raise an exception that causes it to be placed into a suspended state.
Once suspended, jobs can be resumed by calling the Resume-AzureAutomation activity from a Windows PowerShell script. In the Azure Management Portal, you can also manually resume a job. If a worker thread running the runbook crashes, it will find and restart any jobs that need to be completed soon. The resumption on a worker thread will most likely happen on a different worker thread than it was running previously, so don’t make any assumptions about storing any local state on that worker thread.
Source of Information : Azure Automation
Subscribe to:
Post Comments (Atom)
0 comments: