Azure CLI - Authentication Fix

Revert from Web Account Manager

Hello Peoples, I thought this might be a nice quick and easy post to help some people, While working on a new side project for BWC, I came across the fix/change for the Web Account Manager prompt for Azure Cli.

The Issue

Back in May 2024, Azure CLI 2.61.0 was released with a braking change, Which can be seen here in the release notes.

They changed the authentication process from using the traditional Browser method, to the Web Account Manager. Which resembles the more traditional M365 Login screen for Teams/Outlook and alike. However this was not ideal when working for a CSP with multiple customers and having to re-login in every time.

So a short term fix I used to use was:

1
az login --use-device-code

Again, this was not an ideal fix, but forced the login prompt back to the web browser, where I was already authenticated and just chose which account I needed and went back to the terminal.

The Fix

However today while testing some Bicep for an upcoming post, I noticed a link under the az login text

1
2
az login
Select the account you want to log in with. For more information on login with Azure CLI, see https://go.microsoft.com/fwlink/?linkid=2271136

When heading to the link, and this specific heading: Sign in with Web Account Manager (WAM) on Windows

I found, what I’d been wanting for a while.

1
az config set core.enable_broker_on_windows=false

When testing, it did what I wanted, No longer did I get the Web Account Manager Window, But got redirected back to the browser and could choose the account to login in.

Summary

So to summarise this post, Granted some might already know about this - But I did not. So thought it would be nice to share with the wider community, As i know it has been a huge pain point for some people I’ve spoken with about the changes since 2.61.0

Share with your network!

Built with Hugo - Theme Stack designed by Jimmy