Issue Overview
In the complex and dynamic environment of cloud services, automation plays a pivotal role in streamlining operations and enhancing efficiency. Azure Automation provides a powerful platform for automating repetitive and complex tasks across Azure and non-Azure environments. However, like any system, it sometimes encounters issues that can halt automation processes. A recent example involved an error encountered when executing PowerShell 7.2 runbooks in an Azure Automation Hybrid Runbook Worker.
An attempt to activate a runbook named “SampleRunbook” on a V1 Azure Automation Hybrid Runbook Worker—based on the Microsoft Monitoring Agent—resulted in a failure.
The error message:
Exception propagated to sandbox level. Sandbox will be killed. [sandboxId={randomId-1}] [jobId={randomId-2}] [accountId={randomId-3}] [runbookName=SampleRunbook] [runOn=SampleWorker] [jobAction=Activate] [exceptionMessage=System.InvalidOperationException: Runbook type '17' not supported.
This message (Event ID 7001) indicates that the runbook type attempted to be executed was not supported by the V1 worker configuration, specifically pointing to an issue with compatibility regarding PowerShell 7.2 runbooks.
Solution: Upgrading to Azure Automation Hybrid Runbook Worker V2
The resolution to this issue involves upgrading from the V1 Azure Automation Hybrid Runbook Worker to the V2 version, which supports the Arc Extensions. This upgrade is crucial for enabling the execution of PowerShell 7.2 runbooks and ensuring compatibility with newer technologies and scripting environments.
Important Migration Notice
Azure Automation Agent-based User Hybrid Runbook Worker (Windows and Linux) will retire on 31 August 2024 and will not be supported after that date. It’s imperative to complete the migration of existing Agent-based User Hybrid Workers to Extension-based Hybrid Workers before this deadline. Azure Automation now offers onboarding hybrid runbook worker using extensions for both Azure machines and non-Azure machines (through Arc-enabled Server and Arc-enabled VMware vSphere (preview)).
This upgrade is not only a response to compatibility issues but also a proactive measure to align with Azure’s future-proofing strategies. Migrating before the Microsoft Monitoring Agent deprecation deadline ensures that your automation infrastructure remains supported, secure, and capable of leveraging Azure’s full suite of features.