azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az login fails with my Microsoft B2C account in CLI beta version

Open fengzhou-msft opened this issue 5 years ago • 3 comments

Describe the bug

Command Name az login

Errors:

Authentication is migrated to Microsoft identity platform (v2.0). Please run 'az login' to login.

InteractiveBrowserCredential.get_token failed: Interactive authentication is required to get a token. Call 'authenticate' to begin. Traceback (most recent call last): File "C:\Users\fenzhou\Develop\env3\lib\site-packages\azure\identity_internal\interactive.py", line 121, in get_token token = self._acquire_token_silent(*scopes, **kwargs) File "C:\Users\fenzhou\Develop\env3\lib\site-packages\azure\identity_internal\decorators.py", line 45, in wrapper return fn(*args, **kwargs) File "C:\Users\fenzhou\Develop\env3\lib\site-packages\azure\identity_internal\interactive.py", line 198, in _acquire_token_silent raise AuthenticationRequiredError(scopes) azure.identity._exceptions.AuthenticationRequiredError: Interactive authentication is required to get a token. Call 'authenticate' to begin. Authentication is migrated to Microsoft identity platform (v2.0). Please run 'az login' to login.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Use a Microsft B2C account, in my case username: fengzhou*@163.com, subscription: Visual Studio Enterprise.
  • Run az login with CLI beta

Expected Behavior

az login can succeed.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: PIP

azure-cli 2.18.0.1

Extensions:
resource-graph 1.1.0
ssh 0.1.4

Additional Context

fengzhou-msft avatar Jan 28 '21 10:01 fengzhou-msft

Account

yonzhan avatar Jan 28 '21 12:01 yonzhan

Have just encountered this myself in the production version, likely the same in beta.

Mine was because I was forced to install this due to an internal business process: https://docs.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0

This causes a conflict within the Azure CLI.

Check to ensure you don't have that installed as well.

nateforsyth avatar Feb 12 '21 01:02 nateforsyth

Closing as stale. The CLI beta build referenced here is long superseded, and the B2C interactive login path was rewritten under the MSAL migration. If B2C az login fails on current CLI, please open a fresh issue.

MaddyMicrosoft avatar Sep 02 '26 06:09 MaddyMicrosoft