Connect an Azure Runbook with Azure using Powershell
This article says about how to get a connection in a runbook using service principle 
Tags: azure, powershell, azureautomation, runbook