Azure PowerShell Connect-AzureAD and Login-AzureRmAccount

Question:

I have a PowerShell script which uses Connect-AzureAD and also Login-AzureRmAccount.
Even though both use the same credentials, I get asked to enter them twice. Is there any way to only prompt the user once and use the same credentials for both cmdlets?

Answer:

This finally worked for me

it does not display the neat Microsoft login screen but works for my scenarios

Source:

Azure PowerShell Connect-AzureAD and Login-AzureRmAccount by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply