AZ的Azure自动化帐户Runbook错误



当试图设置runbook以缩小应用程序服务计划的大小时,我得到了以下错误。我该如何克服这个错误?

我知道我的PS是有效的并且有效。

Set-AzAppServicePlan -Name 'plan-api-dev' -ResourceGroupName 'rg-dev' -Tier S1 -WorkerSize Small

--

System.Management.Automation.CommandNotFoundException: The term 'Set-AzAppServicePlan' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Set-AzAppServicePlan cmdlet属于Az.Websites模块。正如在使用模块之前将其导入Powershell一样,您需要确保已将Az.Websites模块导入您的Automation帐户。您可以参考本文档来了解如何做到这一点。

最新更新