azureazure-active-directoryazure-virtual-machineazure-rbac

I'm unable to Login to VM with Azure AD user credentials


I'm unable to login to Azure Virtual Machine with Azure AD credential even if select the Option Azure AD Domain Joined while creating the Azure VM.

I'm always getting The Logon attempt failed error.

Assigned Azure Virtual Machine Administration User role, but still unable to login to VM with Azure AD user.

Can someone fix my issue.


Solution

  • I tried to reproduce the same in my environment to Login Azure VM with Azure AD Credentials, As I got same error.

    enter image description here

    I have created Azure VM with Login with Azure AD Option while creating the Virtual Machine.

    Azure Portal > Virtual machines > Create

    enter image description here

    Assign the RBAC role to user for login to VM with Azure AD Credentials.

    Assign any role to users.

    Virtual Machine Administrator Login- User assigned to this role,Can log in to Azure AD Admin privileges.
    Virtual Machine User Login -User assigned this role,Can login in to normal user privileges.
    

    Azure Portal > Virtual machines > Access control (IAM) >Add >Add role assignment

    enter image description here

    Assigned Virtual Machine User Login role to User

    enter image description here

    Verify AADLoginForWindows on Virtual Machine like below.

    Azure Portal > Virtual machines >Extensions + applications >Extensions

    enter image description here

    Change the Remote Desktop Settings with Network Level Authentication,Like below

    enter image description here

    Assign user to Remote Desktop Group using below command.

    net localgroup "Remote Desktop Users" /add "AzureAD\u1@gopivallepuoutlook.onmicrosoft.com"
    
    Ex: user VPN:Theja@Testdemo.onmicrosoft.com
    
    Get-LocalGroupMember -Name "Remote Desktop users"
    

    enter image description here

    Modify the downlaoded RDP File with below Values and save the file.

    enablecredsspsupport:i:0
    authentication level:i:2
    username:s:Theja@Testdemo.onmicrosoft.com (Add your username here)
    domain:s:AzureAD
    

    Finally Logged in with Azure AD (Theja )Credentials.

    enter image description here