question

DaveK-1179 avatar image
0 Votes"
DaveK-1179 asked DaveK-1179 answered

connect-azuread is not valid when run from Orchestrator

I am creating a runbook to gather information from Azure, using the AzureAD PowerShell module. If I run the script from the PowerShell console it works fine, but when I run it from the runbook it errors out with

The term 'Connect-AzureAD' is not recognized as the name of a cmdlet...


Any help would be appreciated.

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello Dave,

the reason for that error is we are not passing credentials in the runbook, you may Use a credential asset to specify a Run As account.

Visit the below links to see about that procedure,

https://docs.microsoft.com/en-us/azure/automation/shared-resources/credentials?tabs=azure-powershell

https://docs.microsoft.com/en-us/azure/automation/automation-hrw-run-runbooks

--please don't forget to upvote and Accept as answer if the reply is helpful--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DaveK-1179 avatar image
0 Votes"
DaveK-1179 answered

Credentials are being passed. The issue is being seen before the credentials are even being processed. It doesn't recognize the Connect-AzureAD cmdlet.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.