Automation account Jobs are queued and then Suspended

Mohamed jihad bayali 1,101 Reputation points
2022-11-22T15:22:46.42+00:00

Hello everyone,

I have an issue, my automation Jobs when launched, move to "Queued" state, and after a moment, they goes to "Suspended" State
This runbook is a powershell one, and it is launched on one of my Azure VMs and do some actions there.

263128-image.png

I stopped all the Suspended Jobs with a powershell Script (I thought maybe the issue was from all the suspended Jobs that where stuck in the queue), but after doing that nothing happened.

Note that, i renewed recently the automation account self signed certificate but didn't import it on my VM , this behavior can be caused by the new certificate which is still not imported on the VM?

Anyone knows how i can import a self signed automation account certificate from Azure so that i can imported to my VM ?

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

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 19,856 Reputation points
    2022-11-29T14:44:36.317+00:00

    Hi @Mohamed jihad bayali ,

    Thank you for posting this question here and I am sorry for the inconvenience you are facing. Please check the following and follow the steps mentioned below to troubleshoot/resolve this issue. As the type of runbook worker was not mentioned (whether Extension based OR agent based), the steps below are listed for both types.

    1. In Azure Portal --> Azure Automation Account --> select "Hybrid worker groups"

    2. Select the specific runbook worker group --> "Hybrid worker". Here, verify the "last seen time". Ensure that this is recent, which would give an idea whether the runbook worker is reporting back to Azure Automation Account or not

    265256-image.png

    3. I could not understand the statement "i renewed recently the automation account self-signed certificate but didn't import it on my VM" - Certificates are generally not required to run runbook on a Hybrid runbook worker. Please check if simple runbook like the one below also fails on Hybrid runbook worker.
    write-output "Hello World!"

    Self-signed certificates are generally used in Azure Automation Hybrid Runbook Worker, when you have configured Hybrid Runbook Worker to run only signed runbooks. In this case, all the runbooks that can be run on the worker needs to be signed with the certificate. You can see this link for more details about it.

    4. If your question is related to "RunAs Account certificate" (as available under "Azure Automation Account" --> "Run as Account"), you can use the steps mentioned in this article to install certificate on Hybrid runbook worker. This exports the runas certificate from Automation Account and imports it in Hybrid Worker. This script is to be run as "Azure Automation Runbook" from "Azure Automation Account".

    You can also use the steps as mentioned in the article below, to export certificate to a storage account and download it locally on your machine.
    https://learn.microsoft.com/en-us/answers/questions/126252/azure-automation-account-certificate.html

    Please note that support for Azure Automation Run As Account will retire on September 30, 2023 and will be replaced with Managed Identities. Before that date, you'll need to start migrating your runbooks to use managed identities. For more information, see migrating from an existing Run As accounts to managed identity to start migrating the runbooks from Run As account to managed identities before 30 September 2023.

    ---
    If the runbook worker has not reported to the Automation Account for a while (as verified in step 2. above), you can follow the steps linked below to reinstall Hybrid worker service on the worker VM.

    1. If the Type of hybrid runbook worker is "Extension based", you can remove the server from the "Hybrid worker group" and add it again. That should help register the VM again as a hybrid worker. You can also check "Microsoft-SMA" logs on the VM for any errors related to hybrid worker service.

    2. If the Type of hybrid runbook worker is "Agent based", follow these steps to remove the hybrid runbook worker AND these steps to add it back. You can also check "Microsoft-SMA" logs on the VM for any errors related to hybrid worker service.

    ---
    If the steps above does not help, please help answer the following questions:-

    1. Can you please elaborate the statement "i renewed recently the automation account self-signed certificate but didn't import it on my VM" - please share additional context like

    a>>. How did you renew this certificate? Are you talking about "Certificates" as available under "Shared resources" in Azure Automation Account as shown below? If yes, these are not related to Hybrid worker runbooks.

    265008-image.png

    b>>. Also, please share details of Hybrid Worker - is it Agent based OR Extension based (Note that - using Extension based (V2) is the recommended platform for Hybrid runbook worker)

    c>>. Please ensure that the "Hybrid runbook woroker" service is running on the worker VM. And check the logs under "Microsoft-SMA" in eventviewer of worker VM for any errors.

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments