connect-azaccount interactivebrowsercredential authentication failed

This article will discuss how to fix this error interactivebrowsercredential authentication failed that I have encountered while running the connect-azaccount PowerShell command.

Connect-azaccount interactivebrowsercredential authentication failed

I recently worked on a critical requirement for one of my clients where I was trying to execute the below Azure PowerShell command.

Connect-AzAccount

After executing the above command, I got the below error

Connect-AzAccount : InteractiveBrowserCredential authentication failed: A window handle must be configured. See 
https://aka.ms/msal-net-wam#parent-window-handles
At line:1 char:1
+ Connect-AzAccount
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
 

Check out the same output in the below screenshot.

interactivebrowsercredential authentication failed

Solution

To fix this issue, first run the below PowerShell command.

Update-AzConfig -EnableLoginByWam $false

After executing the above command, I got the below output.

connect-azaccount interactivebrowsercredential authentication failed

Now, I reran the below command, and this time, it ran successfully without any issues, as shown in the screenshot below.

how do i fix authentication failed

Video Tutorial

You may also like following the articles below

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!