1
votes

I'm trying to log into my Azure account using Azure CLI with the "az login" command. When running the command on my own laptop (which Azure CLI is installed) it works fine - it redirects me to Microsoft's login page and after choosing my account and verifying it with a password and MFA authentication - login is succeeded. enter image description here

However, when running the same "az login" command on a VM I've installed (and has Azure CLI installed as well) and choosing the same account (with the same password and MFA authentication) - the login failed. enter image description here

enter image description here

What can be the reason? I'm logging into the same account with the same user and password. Logging from my own laptop it works and I'm able to run az commands on the subscriptions inside the account, but logging from a VM failed.

Thank you.

2
Looks like a Conditional Access error to me. Maybe you have a rule that login is only allowed from devices that are joined to the AAD tenant? - juunas

2 Answers

1
votes

I found the problem - we have a specific policy in the tenant's scope that denies login into Azure account using CLI which installed on resources inside that account. That's why login from my own laptop works, but login from a VM inside that account failed.

Thank you for your help.

0
votes

Azure AD Conditional Access is blocking you from login. Check the policies here: Azure Portal -> Active Directory -> Security -> Conditional Access

Your Admin might be restricting Access based on Device Status(AAD joined or Compliant) or IP Address based. enter image description here