Azure Automation: Certificate Based Authentication

Modified on Fri, 8 Mar, 2024 at 3:01 PM


Guide used: 


https://stellarlab.net/azure-automation-with-exchange-online-part-1


App Registration

The exchange runbooks in azure use the "ExO PowerShell CBA" app registration with certificate based authentication to connect to exchange management shell.


Certificate

ExO Powershell CBA has the certificate stored on it's object:


To create/"renew" certificate


New-SelfSignedCertificate -Subject "CN=$Name" -KeyLength 2048 -KeyUsageProperty All -KeyAlgorithm 'RSA' -HashAlgorithm 'SHA256' -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter (Get-Date).AddYears(100)  


Create certificate on any machine, export including the private key, additionally export without the private key:


Make note of the private key in password manager and store in CRST IT Support - Documents\01_Central Store\2_Documentation\0_Central & 365 Network Stuff\Automation Certificate


Upload the .cer to the App Registration mentioned above.

Upload the .pfx to the Automation account

Finally, update the cert name in the automation script:



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article