Azure Automation Hybrid Workers stuck in Queue

AdminAS 141 Reputation points
2025-01-13T21:02:37.1366667+00:00

Okay, please someone explain something to me.

I have been working with PowerShell runbooks for over 5 years now and running into this issue has always eluded me. The only real way to monitor how PS runbooks work on a Hybrid worker is to stumble on the right one's Event Viewer. You will notice a few cryptic events happening about a 'sandbox' here and a 'hybrid runbook' there, referencing the runbook being ran.

What I don't understand is why i notice it 'pings' a slew of events continuously while the UI shows its in 'Queue'. There is no indication if it will even pick it up and most of the time the errors thrown are horrible to identify. It rarely shares cmdlet errors if the service fails. So what am I missing? Can someone give me an explanation that doesn't involve the inadequete documentation MSoft provides. I can of course get logs of bad cmdlets using Azure Analytics, but it doesn't explain the service. I also know it 'pings' the service every 30 seconds to get some jobs, but why does it SHOW its found the job, but won't actually take the job. It even says it drops it...

Someone please help me with this insanity!

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,297 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pavan Minukuri 1,045 Reputation points Microsoft Vendor
    2025-01-15T18:29:42.73+00:00

    Hi AdminAS
    Welcome to Microsoft Q&A! Thanks for asking question here!
    1.When a PowerShell runbook is submitted to a Hybrid worker, it first enters the "Queued" stage, waiting to be picked up by the worker, which checks for new jobs periodically, causing the "pings" in the Event Viewer.
    2.Once the worker picks up the runbook, it moves to the "Running" stage to execute the code, and any errors will be logged in the Event Viewer or job output.
    3.If the runbook fails to execute or is dropped by the worker, there may be an issue with the worker or the runbook code.

    To troubleshoot, check the following
    Check the Event Viewer logs on the worker for any errors or warnings related to the runbook.

    Check the job output in the Azure portal for any errors or warnings related to the runbook.

    Check the runbook code for syntax errors or other issues that might cause it to fail.

    Refer: https://jeffbrown.tech/azure-automation-hybrid-worker/
    https://learn.microsoft.com/en-us/azure/automation/automation-hybrid-runbook-worker
    https://www.youtube.com/watch?time_continue=1&v=ajmlau0JZdY&embeds_referring_euri=https%3A%2F%2Fwww.perplexity.ai%2F&embeds_referring_origin=https%3A%2F%2Fwww.perplexity.ai&source_ve_path=MjM4NTE
    If you required anything, please let us know!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.