One VM as hosts for multiple automation accounts hybrid workers

Sławomir Swat 0 Reputation points
2025-04-04T11:07:16.3466667+00:00

Can a one Azure VM be a hosts for two or more extension based hybrid workers, each for different automation account? I have selected same VM as hybrid worker for two different Automation Accounts, and one is working fine, the other one shows that in never actually been connected:

Microsoft.Azure.Management.Automation.Models.SystemData

WorkerType : HybridV2

RegisteredDateTime : 4/3/2025 2:01:48 PM +00:00

LastSeenDateTime : 1/1/0001 12:00:00 AM +00:00

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

1 answer

Sort by: Most helpful
  1. Vinodh247 32,846 Reputation points MVP Moderator
    2025-04-05T10:41:40.7766667+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    No, a single Azure VM cannot act as a host for extension based Hybrid Runbook Workers (HybridV2) for multiple Automation Accounts at the same time. This limitation is by design for extension-based Hybrid Workers (HybridV2).

    Why this happens:

    When you install the Hybrid Runbook Worker extension (HybridV2) on a VM for one Automation Account, it tightly couples that VM with that specific Automation Account. Internally:

    • The extension registers the VM to one Automation Account.
    • Trying to register it again for a second Automation Account overwrites the first registration or fails silently.
    • That is why the second Automation Account shows LastSeenDateTime : 1/1/0001, meaning it was never actually able to connect.

    Workaround:

    If you want to use the same VM for multiple automation accounts, your options are:

    1. Use Classic Hybrid Workers (HybridV1):

    Classic Hybrid Workers do support multiple Automation Accounts on the same VM.

    You manually install the agent and configure each worker group separately.

    This model is more flexible but does not benefit from the newer capabilities of HybridV2 (like auto-scaling, better management, etc.).

    1. Use separate VMs or containers:

    Spin up a separate VM or container for each Automation Account.

    Register the HybridV2 extension separately in each.

    1. Consolidate runbooks into one Automation Account:

    If possible, refactor your runbooks and schedules so that they run from a single Automation Account.

    Then have only one HybridV2 agent installed on the VM.

    Summary:

    One VM = One Automation Account for HybridV2.

    • HybridV1 supports multiple accounts but is older.
    • To run multiple accounts, use multiple VMs or shift back to HybridV1.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.


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.