How to get error messages from Get-AzLogicAppRunAction

芹沢 基樹 111 Reputation points
2021-03-04T07:38:05.423+00:00

Get-AzLogicAppRunAction returns workflow results. but how can I get error codes and error messages of actions from the results?

Get-AzLogicAppRunAction -ResourceGroupName contoso-LogicApps-RG -Name contoso_flow1 -RunName xxxx

Code : BadRequest
EndTime : 1/7/2021 10:27:43 AM
Error : {code, message} <---- how can I the error code and the error message

...

Thanks,

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,322 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,796 Reputation points
    2021-03-04T14:26:05.343+00:00

    Hi @芹沢 基樹

    The output of Get-AzLogicAppRunAction will be an array of WorkflowRunAction. You can iterate through the array value for the property Error. You need to check the HasValues field to know if the object contains the error and message details or not.

    $WorkflowRunActionArray = Get-AzLogicAppRunAction -Name testmak -ResourceGroupName logicapptest -RunName 08585867709937474078259108588CU31

    $ErrorDetails = $WorkflowRunActionArray[0].Error

    Below is the output of $ErrorDetails and check the HasValues field and iterate to other fields inside the object.

    HasValues    : False  
    Type         : String  
    Parent       : {}  
    Root         : {code, message}  
    Next         :   
    Previous     :   
    Path         : code  
    First        :   
    Last         :   
    LineNumber   : 0  
    LinePosition : 0  
      
    HasValues    : False  
    Type         : String  
    Parent       : {}  
    Root         : {code, message}  
    Next         :   
    Previous     :   
    Path         : message  
    First        :   
    Last         :   
    LineNumber   : 0  
    LinePosition : 0  
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.