How to run az.automation cmdlets from inside a runbook?

Jonathan Posey 0 Reputation points
2024-07-19T20:30:16.43+00:00

From within an Azure runbook I want to run get-azautomationjob to find out information about jobs. I ran a get-command from within the runbook, and it says I have that cmdlet available. But when I run it, there is no data returned(variable is null), but there's also no error. There's no evidence at all that it even tried to run. Any ideas?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 8,080 Reputation points
    2024-07-19T22:10:01.25+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Ensure that you are providing the required parameters, particularly -AutomationAccountName and -ResourceGroupName.

    If you are filtering by job status, confirm that there are indeed jobs with that status. You can try omitting the status parameter to retrieve all jobs.

    Add debugging information to your runbook to see what is happening during execution. Use Write-Output or Write-Verbose to log messages that can help identify where the issue lies.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

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.