SOLVED

Azure automation account script error

Brass Contributor

Hi

 

I have an azure automation account and all runbooks are failing. I don't know why. 

 

As a test I only ran this command, and it fails too. 

$cred = Get-AutomationPSCredential -Name "Name" 
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -Credential $cred

This is the job Exception log:

Connecting to remote server outlook.office365.com failed with the following error message : Bad Request For more information, see the about_Remote_Troubleshooting Help topic. (Connecting to remote server outlook.office365.com failed with the following error message : Bad Request For more information, see the about_Remote_Troubleshooting Help topic.)

 

Any ideas

3 Replies
best response confirmed by VirtualTech (Brass Contributor)
Solution

I've got the same issue.
Check under your "Automation Account / Modules" the module version of "ExchangeOnlineManagement".
It has to be at least V3 - if you still have V2, you'll get this issue - im my case since Aug 10.
At 02:30am runbook was fine then on the next schedule at 10:30am it failed.

Updating the module to v3.2.0 solved my issue.

Hi

I needed to updated the exchange online module in azure
1 best response

Accepted Solutions
best response confirmed by VirtualTech (Brass Contributor)
Solution

I've got the same issue.
Check under your "Automation Account / Modules" the module version of "ExchangeOnlineManagement".
It has to be at least V3 - if you still have V2, you'll get this issue - im my case since Aug 10.
At 02:30am runbook was fine then on the next schedule at 10:30am it failed.

Updating the module to v3.2.0 solved my issue.

View solution in original post