Logging into VM using AzureAD

Steve 1 Reputation point
2023-04-11T13:10:58.2766667+00:00

Hi All I have created a virtual machine in Azure in the Qatar region and I can access this virtual machine from the Sydney region via OpenVPN, which is setup in Azure. I created a virtual network peering to ensure there is comms between the 2 regions and I can confirm I can log into the Qatar virtual machine using the local account login. However, I am getting an error when I try to log into the Qatar virtual machine when I try to authenticate using Active Directory, this is despite me enabling the Login with Azure AD during the setup of the Qatar virtual machine, adding the AD extension and enrolling myself via the IAM. The error message is below. I am lost, as I have tried everything I can think of, such as re-enrolling myself using the IAM for Windows Standard and Administrator User, uninstalling and reinstalling the AD extension and rebooting the machine. Again, I can log in using the local account but using the Azure AD login gives me the flexibility to manage accounts centrally.  Any help is greatly appreciated!  r/AZURE - Logging into VM using AzureAD

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,988 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
25,050 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,487 Reputation points Moderator
    2023-05-08T06:28:20.0666667+00:00

    Hello Steve

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Based on the information you provided, it seems like you have followed the correct steps to enable Azure AD authentication during the setup of the virtual machine and have enrolled yourself via the IAM. However, you are still getting an error message when trying to log in using Azure AD credentials.

    -Ensure that the Azure AD extension is installed and running on the virtual machine.
    Get-Service AADLoginForWindows

    If the service is not running, you can start it by running the following command:

    Start-Service AADLoginForWindows

    Ensure that the virtual machine is joined to the correct Azure AD tenant.

    Get-AzureADComputer

    This should return information about the virtual machine, including the Azure AD tenant it is joined to.

    Ensure that the user account you are trying to log in with is assigned the correct Azure AD role. To log in to a virtual machine using Azure AD credentials, the user must be assigned the Virtual Machine Administrator Login or Virtual Machine User Login role. You can check this by going to the Azure portal, selecting the virtual machine, and checking the Access control (IAM) settings.

    Hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.