Connecting to VM from Azure Automation Runbook

Brass Contributor

I'm looking for some recommended solutions as to the best way forward here, or even if there is a way forward...!

 

Basically, what we are trying to do is simply connect to domain joined VM's from an Azure Automation Runbook, once connected then we can do whatever we like, restart services, kill processes etc.

 

I'm working in a locked down environment, the creation of a Run-As-Account with Contributor rights to a subscription is never going to happen so I looked at alternatives.

I see there is an option to lock down the Service Principal after creation but this still looks like a world of pain to try and push out into a locked down environment.

To get around this I've created literally a blank Automation Account, not connected to an LA Workspace nor does it have a RunAs Account.

I've created a credential under Automation Account / Credential. The Runbook is able to obtain that credential but I then hit the usual connection errors when trying to create a connection back to our domain joined Azure VMs. I think it is because I need to be using HTTPS at this point but presumably I need some sort of certificate to do that ?

I see there is an option to create a Connection under the automation account but this is also asking for certificates.

We have a Certificate authority here but I'm not sure what I need to be requesting ?

 

 

1 Reply
You can absolutely automate processes inside your network with Azure Automation. But you cannot use the sandbox approach. By "sandbox" a mean using the default cloud workers. What you need is a Hybrid Worker, i.e., a worker that runs your runbooks from your own VMs (either on-premises or in your Azure VNet). Please, see the documentation below:

https://docs.microsoft.com/en-us/azure/automation/automation-hybrid-runbook-worker