如何解决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,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 模块导入您的自动化帐户。您可以参考 THIS 文档了解如何操作。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。