YYYY-MM-DDTHH:MI:SSZ [Error] ERROR: The term 'Get-AzLogicApp' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Exception : Type : System.Management.Automation.CommandNotFoundException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : The term 'Get-AzLogicApp' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. HResult : -2146233087 TargetObject : Get-AzLogicApp CategoryInfo : ObjectNotFound: (Get-AzLogicApp:String) [], ParentContainsErrorRecordException FullyQualifiedErrorId : CommandNotFoundException InvocationInfo : ScriptLineNumber : 6 OffsetInLine : 9 HistoryId : 1 ScriptName : C:\home\site\wwwroot\HttpTrigger1\run.ps1 Line : $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost PositionMessage : At C:\home\site\wwwroot\HttpTrigger1\run.ps1:6 char:9 + $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost + ~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\HttpTrigger1 PSCommandPath : C:\home\site\wwwroot\HttpTrigger1\run.ps1 InvocationName : Get-AzLogicApp CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, C:\home\site\wwwroot\HttpTrigger1\run.ps1: line 6 CommandName : Get-AzLogicApp TargetSite : Name : LookupCommandInfo DeclaringType : System.Management.Automation.CommandDiscovery, System.Management.Automation, Version=7.2.6.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35 MemberType : Method Module : System.Management.Automation.dll Message : The term 'Get-AzLogicApp' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Data : System.Collections.ListDictionaryInternal Source : System.Management.Automation HResult : -2146233087 StackTrace : at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context) at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin, ExecutionContext context) at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin) 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) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) TargetObject : Get-AzLogicApp CategoryInfo : ObjectNotFound: (Get-AzLogicApp:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException InvocationInfo : ScriptLineNumber : 6 OffsetInLine : 9 HistoryId : 1 ScriptName : C:\home\site\wwwroot\HttpTrigger1\run.ps1 Line : $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost PositionMessage : At C:\home\site\wwwroot\HttpTrigger1\run.ps1:6 char:9 + $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost + ~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\HttpTrigger1 PSCommandPath : C:\home\site\wwwroot\HttpTrigger1\run.ps1 InvocationName : Get-AzLogicApp CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, C:\home\site\wwwroot\HttpTrigger1\run.ps1: line 6
Az.LogicApps 及びその依存モジュールがダウンロードされるため、ダウンロードされたファイル一式を \home\site\wwwroot\Modules に配置します。Kudu をご利用の場合には、ドラッグ&ドロップでアップロードいただけます。最終的には以下のようなフォルダ構成となります。Windows OS での Kudu 表示画面例となります。
B. 依存モジュールはあるが Get-AzLogicApp コマンドのリソース グループへのアクセス設定が全くない場合
YYYY-MM-DDTHH:MI:SSZ [Error] ERROR: No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.
Exception : Type : Microsoft.Azure.Commands.Common.Exceptions.AzPSApplicationException ErrorKind : User ErrorLineNumber : 61 ErrorFileName : ClientFactory TargetSite : Name : CreateArmClient DeclaringType : Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory MemberType : Method Module : Microsoft.Azure.PowerShell.Authentication.dll Message : No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login. Data : System.Collections.ListDictionaryInternal Source : Microsoft.Azure.PowerShell.Authentication HResult : -2146232832 StackTrace : at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateArmClient[TClient](IAzureContext context, String endpoint) at Microsoft.Azure.Commands.LogicApp.Utilities.LogicAppClient..ctor(IAzureContext context) at Microsoft.Azure.Commands.LogicApp.Utilities.LogicAppBaseCmdlet.get_LogicAppClient() at Microsoft.Azure.Commands.LogicApp.Cmdlets.GetAzureLogicAppCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet) at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() CategoryInfo : CloseError: (:) [Get-AzLogicApp], AzPSApplicationException FullyQualifiedErrorId : Microsoft.Azure.Commands.LogicApp.Cmdlets.GetAzureLogicAppCommand InvocationInfo : MyCommand : Get-AzLogicApp ScriptLineNumber : 6 OffsetInLine : 9 HistoryId : 1 ScriptName : C:\home\site\wwwroot\HttpTrigger1\run.ps1 Line : $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost PositionMessage : At C:\home\site\wwwroot\HttpTrigger1\run.ps1:6 char:9 + $body = Get-AzLogicApp -ResourceGroupName hakurodablogpost + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\HttpTrigger1 PSCommandPath : C:\home\site\wwwroot\HttpTrigger1\run.ps1 InvocationName : Get-AzLogicApp CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, C:\home\site\wwwroot\HttpTrigger1\run.ps1: line 6 PipelineIterationInfo :
[回避策B]
手順5のアクセス権限の付与手順を実施します。
C. 依存モジュールはあり Get-AzLogicApp コマンドのリソース グループへのアクセス権限がない場合
A(依存モジュールの宣言不足) 及び B(アクセス権限の付与設定漏れ) を順番に解消後、Azure Functions のマネージド ID を有効化したにもかかわらずリソース グループへのアクセス権を付与できていない場合にはヌル オブジェクトに対する操作である旨エラーが発生します。