AndrewJCo
AndrewJCo

Reputation: 65

Azure Runbook - Job could not be stopped

I have a PowerShell Azure Runbook in a Running state.

Pressing Stop via the Azure Portal results in an error message:

"Job could not be stopped".

Using the PowerShell cmdlet Stop-AzureRMAutomationJob results in the error message:

"InternalServerError: {"Message":"An error has occurred."}

From the documentation it looks like the job will be stopped after 3hrs, but is there any other way to stop a Runbook job or deal with a situation like this?

Upvotes: 1

Views: 1269

Answers (2)

Bruno Antunes
Bruno Antunes

Reputation: 1

first u should find the job ID with failed status...

Get-AzureRmAutomationJob -ResourceGroupName $RG -AutomationAccountName $AA | where {$.RunbookName -eq "runbook name" -and $.status -eq "Failed"}

then after stop the runbook

Stop-AzureRmAutomationJob -ResourceGroupName $RG -AutomationAccountName $AA -id JOBID

Upvotes: 0

AndrewJCo
AndrewJCo

Reputation: 65

This issue went to the Microsoft product group to fix and should be fixed now.

Upvotes: 1

Related Questions