cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CrispyFries
Level: Powered On

azure automation job output missing information

I have a flow that creates an Azure Automation runbook job and waits for it to complete, then the next step is to get the job output.

 

It doesn't appear to include any of the warning or error streams from the powershell job. Is there a way to include this?

 

I tested this by writing a runbook that writes output, writes warning and writes a non terminating error.

 

Screenshots below show the job output from azure automation portal (with warning and error) and the output from flow, showing no warning or error

run1.pngrun2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: azure automation job output missing information

Hi @CrispyFries,

 

Could you please share a full screenshot of your flow's configuration?

Could you please show a bit more about the warning message and error message within your Azure Automation Portal?

 

The "Get job output" action of the Azure Automation connector is only used to get the outputs of an Azure Automation job rather than the warning and error message of the Azure Automation job.

 

I afraid that there is no way to get the warning message and error message using the "Get job output" action of Azure Automation connector in Microsoft Flow currently. If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

More details about the "Get job output" action of Azure Automation connector, please check the following article:

https://docs.microsoft.com/en-us/connectors/azureautomation/#get-job-output

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
10 REPLIES 10
Community Support Team
Community Support Team

Re: azure automation job output missing information

Hi @CrispyFries,

 

Could you please share a full screenshot of your flow's configuration?

Could you please show a bit more about the warning message and error message within your Azure Automation Portal?

 

The "Get job output" action of the Azure Automation connector is only used to get the outputs of an Azure Automation job rather than the warning and error message of the Azure Automation job.

 

I afraid that there is no way to get the warning message and error message using the "Get job output" action of Azure Automation connector in Microsoft Flow currently. If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

More details about the "Get job output" action of Azure Automation connector, please check the following article:

https://docs.microsoft.com/en-us/connectors/azureautomation/#get-job-output

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CrispyFries
Level: Powered On

Re: azure automation job output missing information

thanks. i will submit an idea in that forum

Highlighted
ajhstn
Level: Powered On

Re: azure automation job output missing information

@CrispyFries did you find way to bring the output of runbooks back into Flows/Powerapps?

 

CrispyFries
Level: Powered On

Re: azure automation job output missing information

yeah, i wrote the warning and error messages to write-output

try {
# yourcode
}
catch {
$ErrorMsg = $_.Exception.Message
Write-Output "ERROR: something broke - $ErrorMsg"
}
ajhstn
Level: Powered On

Re: azure automation job output missing information

Yeah ok thank you.  I have been using write-output also, but how are you collecting the output and parsing that in the flow?  I tried creating a PS object and converting that to JSON in the PS code, but am unable to get it back to flow?

 

What actions are you using, picture of your flow?

 

CrispyFries
Level: Powered On

Re: azure automation job output missing information

in the azure automation job make sure in the advanced options you have wait for job enabled

aa1.png

then add the azure automation job output action, and in the job ID add the id of the previous azure automation job

aa2.png

 

you can then do whatever you want from there using the content from that, which is the actual job output 

 

aa3.jpg

 

 

ajhstn
Level: Powered On

Re: azure automation job output missing information

Hey @CrispyFries this is essentially what i have, however my "Content" returned from the "Get Job Output" action, returns general output from the azure automation job as well as whatever i output with "write-output".

 

For example, this is the "Content" returned.  As you can see its a table of job details, as well as the output i actually want from the runbook.  How can i grab the json object out of the whole "Content" object?

 

Account      : automationaccount@domain.com
Environment  : AzureCloud​
Tenant       :nnnn-nnnn-nnnn-nnnn-nnnnn
TenantId     : nnnn-nnnn-nnnn-nnnn-nnnnn​
TenantDomain : domain.onmicrosoft.com​

{​
    "UPN":  "user1@domain.com",​
    "Department":  "Technology",​
    "Title":  "Information Technology Manager",​
    "Country":  "Australia"​
}​

 

 

CrispyFries
Level: Powered On

Re: azure automation job output missing information

oh i see, i'm not sure. Maybe you could use an expression on the content to trim it somehow to remove all the stuff outside of the {} and then convert to json within the flow?

ajhstn
Level: Powered On

Re: azure automation job output missing information

But how are you removing that generic job detail out of your Content oject?  Wouldn't you also get that from your own runjob?

CrispyFries
Level: Powered On

Re: azure automation job output missing information

we require the full output of our jobs to update our service desk ticket software so we don't actually do any manipulation on the output, i just trim the content for into 1 specific variable i need to update the sharepoint form with, the rest of the output is sent to the ticket software

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 55 members 4,934 guests
Please welcome our newest community members: