Virtual Machine login using Entra ID from the portal not working when using a custom role.

Sean O'Brien 26 Reputation points
2025-12-03T06:39:40.0066667+00:00

Link to Microsoft Entra ID Authentication article.

When following these instructions, I can successfully see the option to connect to my VM using Entra ID Authentication.

However, if I remove the Virtual Machine Administrator Login (built-in role) assignment from myself, and create a custom role with the same permissions, then assign that to myself, the option disappears.

My understanding was that RBAC was based on permissions as defined in the JSON, including built-in roles. But in this case, the portal UI seems to have a baked-in logic that specifically requires the built-in role to be assigned to you on the resource.

This seems to me that it is NOT evaluating your permissions on the resource, instead it is looking for a specific role, which seems to circumvent the purpose of RBAC entirely.

To reproduce: create a custom role using the Virtual Machine Administrator Login as a template. Assign yourself to the custom role on the VM. Remove Virtual Machine Administrator Login RBAC permissions from yourself.

Result: The option to connect via Entra ID in the portal disappears.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Answer accepted by question author
  1. Sridevi Machavarapu 10,845 Reputation points Microsoft External Staff Moderator
    2025-12-03T07:20:00.79+00:00

    Hello Sean O'Brien,

    Thanks for your patience while we checked this. We were able to reproduce the same behavior, and what you’re seeing is expected.

    When connecting to a VM from the Azure portal using Azure Bastion, the Microsoft Entra ID login option is shown only if the signed-in user has one of the following built-in roles:

    Virtual Machine Administrator Login

    Virtual Machine User Login

    If those roles are removed and only a custom role is assigned, even with the same login permissions, the Entra ID option no longer appears. The Bastion experience in the portal checks for these specific built-in roles, not just the underlying permissions.

    This applies only to the Azure portal + Bastion UI and matches the current Entra ID authentication for Bastion (Preview) behavior. The requirement for these built-in roles is clearly listed in the Prerequisites section of the documentation.

    User's image

    Entra ID login with custom roles still works when using native RDP or Bastion via CLI.

    Workaround:

    To use Entra ID authentication from the Azure portal with Bastion, assign Virtual Machine Administrator Login or Virtual Machine User Login. Custom roles aren’t supported for this portal flow at the moment.

    References

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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