Issue related to runtime version for powershell runbooks

Lihang Jose 20 Reputation points
2025-10-13T18:46:31.63+00:00

When creating an azure automation powershell runbook, how to ensure compatibility between runtime version and imported powershell modules.

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

Answer accepted by question author
  1. Suchitra Suregaunkar 1,880 Reputation points Microsoft External Staff Moderator
    2025-10-13T21:04:58.9466667+00:00

    Hello Lihang Jose,

    Thank you for posting your query on Microsoft Q&A portal.

    PowerShell runbooks in Azure Automation are built on Windows PowerShell. You can write and edit the runbook code directly in the Azure portal using its text editor, or create it offline in any editor and then upload it to Azure Automation.

    The PowerShell version used during execution depends on the Runtime Version you select. Azure’s sandbox environment and Hybrid Runbook Workers can run multiple runbooks side by side, even if they target different runtime versions.

    • PowerShell 7.4 is currently supported for both cloud and hybrid jobs in all public regions, except Brazil Southeast and government clouds.
    • When you choose Runtime Version 7.4, the system uses modules compatible with 7.4. Similarly, selecting Runtime Version 5.1 ensures modules for 5.1 are used.
    • Always make sure the modules match the runtime version you select.

    Example: If you’re automating SharePoint tasks in a runbook set to Runtime Version 7.4, import the SharePoint module built for 7.4. If the runbook uses Runtime Version 5.1, then import the module for 5.1.

    Reference: https://free.blessedness.top/en-us/azure/automation/automation-runbook-types?tabs=lps74%2Cpy10

    Kindly let us know if the solution provided worked for you. If you need any further assistance, please feel free to reach out.

    If you found the comment helpful, please consider clicking "Upvote it".

    Thanks,

    Suchitra.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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