Hi Nikhil,
To configure role assignments for your Microsoft Entra ID-enabled Windows Server VMs:
- For Resource Group, select the resource group that contains the VM and its associated virtual network, network interface, public IP address, or load balancer resource.
- Select Access control (IAM).
- Select Add > Add role assignment to open the Add role assignment page.
- Assign the following role. For detailed steps, see Assign Azure roles by using the Azure portal.
- Select the required UMI which you need to assign
Or you can also do by
$resourceGroupName = "YourResourceGroup"
$vmName = "YourVMName"
$identityClientId = "YourManagedIdentityClientId"
Set-AzVMAADExtension -ResourceGroupName $resourceGroupName -VMName $vmName `
-AADTenantID "YourAADTenantID" -IdentityClientId $identityClientId
Replace YourResourceGroup
, YourVMName
, YourManagedIdentityClientId
, and YourAADTenantID
with your actual values.
Please check this doc for more ref --> https://learn.microsoft.com/en-us/entra/identity/devices/howto-vm-sign-in-azure-ad-windows
Kindly accept answer , if it helps ., Thanks