Search code examples
azurepowershellpowershell-5.1

Powershell can not run Connect-AzAccount when opening the Powershell "as different user"


I have a very strange problem which I cant wrap my head around. I have a host with PowerShell 5.1 installed. When I run the PowerShell "regulary" with the user logged in to Windows I can use the Connect-AzAccount command: Command working

When I open the Powershell location and then select "run as different user" and login to the pwoershell with a different user the command does not work. Everytime I run Connect-AzAccount the command start but fails to open the login window returning the following error: Command fails Then the PowerShell session freezes and i need to close it with TaskManager.

I ran $PSVersionTable in both Powershell sessions and it is the same in both sessions: PSVersion

I'm at a complete loss whats the issue here. Did any of you guys experience something like this before?


Solution

  • Found a solution. Downgraded from Az.Accounts v. 3.0.0 to 2.19.0. With the older version everything works as expected.