Skip to content

Import-AzAutomationRunbook cmd : Runbook type 'PowerShell72' not supported  #24779

Open
@SiddhiGupta10

Description

@SiddhiGupta10

Description

Unable to import PowerShell automation runbook of runtime 7.2; runbook_type : "PowerShell72"

Import command is throwing invalid type error.

Issue script & Debug output

Following command returns an error when run on Self hosted agent.

        [pscustomobject]@{
        RunbookName='listSharePointUsersPermission';
        OutputFolderPath=$outputfolderpath;
        SourcePath=$sourcepath;
        RunbookType="PowerShell72";
        Tags=@{"Workload Name"="Development Testing Services"}
        }

            Import-AzAutomationRunbook `
            -AutomationAccountName $targetAutomationAccountName `
            -Name $eachLine.RunbookName `
            -Path $eachLine.SourcePath `
            -Published `
            -ResourceGroupName $targetResourceGroupName `
            -Type $eachLine.RunbookType `
            -Force;

Environment data

Running on linux self-hosted agent.
AzurePowerShell@5 task

Module versions

azurePowerShellVersion: 'LatestVersion'

Error output

Cannot validate argument on parameter 'Type'. The argument "PowerShell72" does not belong to the set "PowerShell,GraphicalPowerShell,PowerShellWorkflow,GraphicalPowerShellWorkflow,Graph,Python2,Python3" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
Failed

Activity

added
bugThis issue requires a change to an existing behavior in the product in order to be resolved.
needs-triageThis is a new issue that needs to be triaged to the appropriate team.
on May 1, 2024
added
needs-triageThis is a new issue that needs to be triaged to the appropriate team.
and removed
needs-triageThis is a new issue that needs to be triaged to the appropriate team.
on May 1, 2024
isra-fel

isra-fel commented on May 7, 2024

@isra-fel
Member

Hi @SiddhiGupta10 are you running the script in an Azure DevOps pipeline?

added
needs-author-feedbackMore information is needed from author to address the issue.
and removed
needs-triageThis is a new issue that needs to be triaged to the appropriate team.
on May 7, 2024
SiddhiGupta10

SiddhiGupta10 commented on May 7, 2024

@SiddhiGupta10
Author
added
needs-team-attentionThis issue needs attention from Azure service team or SDK team
and removed
needs-author-feedbackMore information is needed from author to address the issue.
on May 7, 2024
xandris

xandris commented on Mar 13, 2025

@xandris

I've run into this issue too. I need to import a PowerShell 7.2 workbook but that -Type parameter doesn't permit the value PowerShell72.

Rincey

Rincey commented on May 20, 2025

@Rincey

@xandris @SiddhiGupta10

I came here to post the same issue, but with a potential solution:
VSCode IntelliSense autocompleted runbooktype as Powershell72 which failed. But doing a get-azautomationrunbook on an existing runbook, it reported the type as PowerShell72, so I tried the import again with the tweaked type. Worked for me that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutomationbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedneeds-team-attentionThis issue needs attention from Azure service team or SDK team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xandris@isra-fel@Rincey@SiddhiGupta10

        Issue actions

          Import-AzAutomationRunbook cmd : Runbook type 'PowerShell72' not supported · Issue #24779 · Azure/azure-powershell