I have an app running on a local machine that I want to be able to run a powershell script to turn on my Azure Vm's. I have a runbook in my subscription to turn them on and have the functionality to run the runbook. from the Powershell script. My only problem right now is authenticating to my Azure subscription. I have a Automation account and the connection and certificate that comes with it but I'm a bit confused as to whether or not I can use this to perform this functionality.
0
votes
1 Answers
0
votes
you could use service principal auth, or certificate auth (well, azure ad user auth as well, but somehow microsoft thinks its not safe enough).
Basically go through this link: https://blogs.msdn.microsoft.com/benjaminperkins/2017/01/20/execute-an-azure-powershell-arm-script-without-prompting-for-credentials
ps. one fine option for locally running script: Enable-AzureRmContextAutosave, which would allow you to auth once and after that just reuse that auth on you local powershell