AZ login does not work for me inside VM

DeepakAzure 1 Reputation point
2021-03-15T05:27:31.817+00:00

Login doesn;t work for me inside VM, getting following error. Tried to follow the steps mentioned in various blogs, still can not fix it. I may need your help to resolve this issue. Steps to receate: Create VM in eastus and Login to Windows VM type az login in windows powershell PS C:\Users\msadmin> az login The default web browser has been opened at https://login.microsoftonline.com/common/oauth2/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with az login --use-device-code. You have logged in. Now let us find all the subscriptions to which you have access... The following tenants require Multi-Factor Authentication (MFA). Use 'az login --tenant TENANT_ID' to explicitly login to a tenant. 2d915766-3786-46af-8a38-286bff8cc134 'Default Directory' No subscriptions found.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,213 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rahul Metangale 106 Reputation points
    2021-03-16T11:23:49.22+00:00

    Hi @DeepakAzure

    I am assuming when you directly log in to Azure portal from web browser you are able to see subscriptions for which you have access.
    Is your account associated with multiple tenants? if yes then try specifying the tenant ID (tenant id can be found under Azure AD- Overview section)
    az login --tenant TENANT_ID

    I hope this helps

    1 person found this answer helpful.
    0 comments No comments