Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.13k stars 3.77k forks source link

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

Open SiddhiGupta10 opened 2 months ago

SiddhiGupta10 commented 2 months ago

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
isra-fel commented 2 months ago

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

SiddhiGupta10 commented 2 months ago

HI @Yeming @.***>,

Yes, running from Azure DevOps pipeline.

Thanks & Regards, Siddhi Gupta Consultant - Azure Cloud and AI @.***

From: Yeming Liu @.> Sent: Tuesday, May 7, 2024 12:39 PM To: Azure/azure-powershell @.> Cc: Mention @.>; Author @.> Subject: Re: [Azure/azure-powershell] Import-AzAutomationRunbook cmd : Runbook type 'PowerShell72' not supported (Issue #24779)

Hi @SiddhiGupta10https://github.com/SiddhiGupta10 are you running the script in an Azure DevOps pipeline?

- Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-powershell/issues/24779#issuecomment-2097600185 or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXAXVGYV3ENCIBQUA4HQ6GTZBB4YXBFKMF2HI4TJMJ2XIZLTS6BKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLAVFOZQWY5LFVEYTQNJQGEZTCNBQURXGC3LFVFUGC427NRQWEZLMQKSXMYLMOVS2UMJSGQYDENJYGIZDDJDOMFWWLKLIMFZV63DBMJSWZAVFOZQWY5LFVIYTKMRSG4YDIMBZGOSG4YLNMWUWQYLTL5WGCYTFNSBKK5TBNR2WLKRSGAYDMOJTGU4DQMNENZQW2ZNJNBQXGX3MMFRGK3FMON2WE2TFMN2F65DZOBS2YSLTON2WKQ3PNVWWK3TUUZ2G64DJMNZZNAVEOR4XAZNKOJSXA33TNF2G64TZUV3GC3DVMWUDEMZYHEYTCOJUQKSHI6LQMWSWS43TOVS2K5TBNR2WLKRSGI3TGMZWGAZDGOECUR2HS4DFUVWGCYTFNSSXMYLMOVS2SMJYGUYDCMZRGQYIFJDUPFYGLJLMMFRGK3FFOZQWY5LFVIYTENBQGI2TQMRSGGBKI5DZOBS2K3DBMJSWZJLWMFWHKZNKGE2TEMRXGA2DAOJTQKSHI6LQMWSWYYLCMVWKK5TBNR2WLKRSGAYDMOJTGU4DQMNHORZGSZ3HMVZKMY3SMVQXIZI. You are receiving this email because you were mentioned.

Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.