Azure automation runbook git integration

Vadlakonda Nikhil Sai 1 Reputation point
2022-12-02T04:06:08.943+00:00

Hi Team,

I am executing powershell script from azure automation runbook and the script consists git commands which interacts with a azure devops repo and pushes the code to the repo. But the communication is not happening between automation runbook and repo even while using the valid pat. the error is git is not a valid command. So, it seems to be that git modules are not present in the runbook due to which it is not getting executed. Please help me with the modules which support git commands to work in automation runbook or any other solution which helps me in communicating with the azure devops repo

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

1 answer

Sort by: Most helpful
  1. Maxim Sergeev 6,571 Reputation points Microsoft Employee
    2022-12-05T05:13:21.76+00:00

    Hi there,

    If you run your runbooks and the git commands in Azure sandbox, it will be failed if it's not a part of custom powershell modules.
    Basically, there is 2 options:

    1) create your custom module with the git and import it to Azure Automation (I'm not sure that this will work in Azure Automation sandboxes at all)
    2) create a VM with Hybrid Worker role, install git into the VM, run your runbooks in the HRW server

    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.