Set Up your Entra ID Tenant
This guide contains the Microsoft Azure configuration required for users to authenticate to an Entra ID-joined virtual machine (VM) using their Entra ID credentials (username and password) over RDP.
Multi-Factor Authentication (MFA) is not supported for this feature.
The goal of this guide is for you to obtain three required values required by the feature:
-
Tenant ID: Your Azure Active Directory tenant identifier.
-
Application ID: The client ID of the app registration.
-
Azure-Provided Public DNS Name (FQDN): The VM's public hostname.
Use the table to review the required values, their location in this guide, and an example:
| Required Value | Location in this Guide | Sample |
|---|---|---|
| Tenant ID | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
| Application ID | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
| Azure-Provided Public DNS Name (FQDN) | Section E, Step 14 | my-vm.eastus.cloudapp.azure.com |
Other sections and steps are essential to validate the configuration and ensure the feature works properly. Consider reading this guide to its entirety.
Requirements
To follow this guide you must meet the following requirements:
-
An active Azure subscription.
-
A global administrator (or equivalent) role in Entra ID.
-
A Windows Virtual Machine (VM).
Entra ID login is only supported on Windows Operating System (OS)
Step-by-Step Guide
This guide contains the following sections:
A. Register an Application Registration
B. Verify or Configure an Existing Application Registration
E. Verify/Configure an Existing VM
Follow these steps to create a new App Registration from scratch. If you have already created an App Registration, continue to Section B.
1. Create a New App Registration
-
Navigate to your Microsoft Entra ID instance > Manage > App registrations > New registration.
-
Assign a unique name, for example:
RDP Entra ID Auth. -
Select the account type
Single tenant.
This is the only supported account type. -
Skip the Redirect URI field.
-
Click Register.
-
Navigate to the App Overview page.
From the App Overview page, ensure you capture the following items:
Application (client) ID: This is your Application ID.
Directory (tenant) ID: This is your Tenant ID.
2. Enable ROPC (Public Client Flow)
-
In the app registration, open the Manage > Authentication page.
-
Open Settings.
-
Set Allow public client flows to
Enabled. -
Click Save.
3. Grant Microsoft Remote Desktop API Permission
-
In the app registration, open the Manage > API permissions > Add a permission.
-
Select APIs my organization uses.
The system displays a list of your organization's APIs. -
Search and select Microsoft Remote Desktop.
The Microsoft Remote Desktop API configurations page opens. -
Select Permissions > user_impersonation > Add permissions.
-
Click
Grant admin consent for [your tenant]and confirm.
The feature uses the scope
ms-device-service://termsrv.wvd.microsoft.com/name/{vm-hostname}/user_impersonation. Granting user_impersonation on the Microsoft Remote Desktop API covers this scope.This tenant probably does not have the Microsoft Remote Desktop enterprise application instantiated.
Have a user with Application Administrator or Cloud Application Administrator run the following command in Azure Cloud Shell and then return to this step:
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Applications
Connect-MgGraph -TenantId "[tenantID]" -Scopes "Application.ReadWrite.All"
New-MgServicePrincipal -AppId "a4a365df-50f1-4397-bc59-1a1564b8bb9c"
After the App Registration is configured, continue with Step 7 in Section B.
Follow these steps if an App Registration already exists. Each step verifies that the required configuration is in place.
4. Locate the Existing App Registration
-
Navigate to your Microsoft Entra ID instance > Manage > App registrations > All applications.
-
Search for and select the existing App Registration.
From the App Overview page, ensure you capture the following items:
Application (client) ID: This is your Application ID.
Directory (tenant) ID: This is your Tenant ID.
5. Verify ROPC is Enabled
-
In the app registration, open the Manage > Authentication page.
-
Open Settings.
-
Ensure that Allow public client flows is set to
Enabled.
You can enable this flag it at this point.
6. Verify API Permission is Granted
-
In the app registration, open the Manage > API permissions.
-
Ensure that Microsoft Remote Desktop / user_impersonation is listed with Status: Granted.
You can grant this permission at this point.
7. Run the approve-rdp-client-cloudshell Cloud Shell Script
To complete an App Registration configurations, your must run a Cloud Shell script once for each App Registration. This script connects to Microsoft Graph in the specified tenant and adds the specified client app’s service principal to Microsoft Remote Desktop’s approvedClientApps list so that app is allowed to request RDP remote-connection tokens. Run the approve-rdp-client-cloudshell script with the following steps:
-
In your Azure Portal, click the Cloud Shell icon (>_) in the top navigation bar.
-
Select PowerShell when prompted for the shell type.
-
Select Subscription if prompted
-
Right-click the link to download and upload the approve-rdp-client-cloudshell script into the Cloud Shell session.
-
Run the script using the following syntax:
./approve-rdp-client-cloudshell.ps1 -ClientId “[clientID]” -TenantId “[tenantID]” -
The system displays the following message:
To sign in, use a web browser to open the page https://login.microsoft.com/device and enter the code [code] to authenticate.Copy the
[code]section of the message. -
Open
https://login.microsoft.com/devicein your browser. -
Paste the code and login using your account.
-
Click Continue
This script only needs to be run once per App Registration.
After you run the script, the App Registration is complete and you can continue to configure your tenant.
8. Disable MFA for RDP Users
Create a Conditional Access policy targeting only the RDP app registration and granting access without requiring MFA. This is the recommended approach, as it keeps MFA enforced for all other apps in your tenant.
If you already have Conditional Access policies that enforce MFA for all apps, add the RDP app registration to their exclusion list instead of creating a new policy.
-
Navigate to your Microsoft Entra ID instance > Security > Conditional Access > New policy.
-
Assign a unique name, for example:
RDP Entra ID – No MFA. -
Select the user(s) or group(s) that will connect via RDP in the Users section.
-
Target resources in Cloud apps > Registered App
You Created a New App Registration in Step 1, Part A; or validated the regisitration in Step 4, Part B. -
Ensure that Require multifactor authentication is Unchecked.
-
Set policy to Enabled and click Create.
After you configure your tenant to remove MFA requests for RDP apps, you can continue to create a new VM.
If your tenant does not use Conditional Access at all, you can disable Security Defaults in the following path:
Microsoft Entra ID > Manage > Properties > Manage security defaults > Disabled.
This removes MFA enforcement globally for all users and apps, which is not recommended in production environments.
Follow these steps when provisioning a brand-new virtual machine. Azure will automatically Entra ID-join the VM and install the required extension during the creation process.
9. Create the VM in the Basics Tab
-
Navigate to Virtual Machines > Create > Virtual machine.
-
Fill in Subscription, Resource group, and Virtual machine name.
-
Choose a Region and select a Windows image, for example:
Windows Server 2022 DatacenterorWindows 11 Enterprise. -
Choose the Size and set a local admin Administrator account used for emergency access only.
-
Ensure port 3389 RDP is allowed under Inbound port rules.
The local administrator account is separate from Entra ID and is used as a fallback only. It does not affect Entra ID authentication.
10. Enable Entra ID Login in the Management Tab
This is the step that Entra ID-joins the VM and installs AADLoginForWindows automatically.
-
Click the Management tab at the top of the creation wizard.
-
Under Microsoft Entra ID, check the box Login with Microsoft Entra ID.
Enabling this option automatically Entra ID-joins the VM and installs the
AADLoginForWindows extension after provisioning. No manual extension installation is needed.11. Review and Create
-
Click Review + create and wait for validation to pass.
-
Click Create and wait for the deployment to complete.
After the VM is created, continue on Step 13, Part E.
Follow these steps if the VM already exists. Each step verifies the required configuration is in place and guides you to add anything that is missing. Steps 13 and 14 also apply to VMs created in Section D.
12. Verify/Install the AADLoginForWindows Extension
-
On the VM page, navigate to Settings > Extensions + applications.
-
Review if AADLoginForWindows is listed with status Provisioning succeeded.
-
If installed, continue to step 13.
If it is not installed:-
Click Add.
-
Search for Azure AD Login (AADLoginForWindows) and select it.
-
Click Next > Review + create > Create.
-
Wait until the extension status displays Provisioning succeeded.
-
13. Assign the VM Login Role to the User
The user must be assigned a role on the VM resource to log in via Entra ID.
-
On the VM page, navigate to Access control (IAM) > Role assignments.
-
Review if the user already has one of the following roles: Virtual Machine User Login or Virtual Machine Administrator Login role
-
If the role is assigned, continue to Step 14.
If it is not assigned:
-
Click Add role assignment.
-
Select the role
-
Virtual Machine User Login
-
Virtual Machine Administrator Login for admin access
-
-
Select the Entra ID user(s) that will connect via RDP.
-
Click Review + assign.
-
14. Note the FQDN and Verify it Matches the VM Name
-
On the VM Overview page, locate the DNS name field.
-
If it shows Not configured, click the link and assign a DNS name label to the public IP.
IMPORTANT:
Capture the Azure-Provided Public DNS Name (FQDN). This is the full hostname in the DNS name field, for examplemy-vm.eastus.cloudapp.azure.com. -
Verify the DNS hostname matches the VM's machine name in Entra ID considering the following:
-
The DNS hostname is the first segment of the FQDN, before the first dot, for example:
my-vmfrommy-vm.eastus.cloudapp.azure.com
-
-
Navigate to Microsoft Entra ID > Manage > Devices > All Devices.
-
Find the device entry for this VM.
-
Confirm its Name matches the DNS hostname exactly.
The DNS hostname and the Entra ID device name must match exactly for the feature to work. If they differ, update the DNS name label on the public IP to match the machine name shown in Entra ID Devices.
15. Initial RDP Authentication (Required Once per User per VM)
Before you can use the Entra ID RDP feature, each user must authenticate to the VM at least once using a direct RDP connection with their Entra ID credentials. This registers the user on the VM and is required before feature-based connections will work. To do this, using any RDP client:
-
Connect to the VM using its FQDN, captured in Step 14.
-
Log in with the Entra ID username (e.g. user@domain.com) and password.
-
After the log in is successful, the initial authentication is complete and the session can be disconnected.
Repeat this step for every user and for each VM they will access through this feature.
This is a one-time requirement per user per VM. Once completed, the feature will authenticate subsequent connections automatically without requiring this step again.
After you successfully authenticate each user, the feature works automatically.
Troubleshooting
Navigate to Troubleshooting Entra ID Authentication for RDP Services for known error codes during this process.