An Azure service that is used to provision Windows and Linux virtual machines.
whoami in the Linux VM shows the local Linux account name that the SSH session is running under (for example, adminuser). It never shows the Microsoft Entra ID user or the Azure role name.
The Virtual Machine User Login / Virtual Machine Administrator Login roles are Azure RBAC roles used only to authorize whether a Microsoft Entra user is allowed to sign in to the VM. They do not rename or change the local Linux username, and they are not reflected in whoami output.
To use Microsoft Entra ID for SSH on Linux and still see a local username, the following must be in place (independent of whoami):
- The VM must have a system-assigned managed identity enabled before installing the Microsoft Entra login extension; otherwise the extension installation fails with non-zero exit codes and sign-in will not work.
- The AADSSHLoginForLinux (or equivalent) extension must be installed and in
Provisioning succeededstate. - The user must be assigned Virtual Machine User Login or Virtual Machine Administrator Login at the VM, resource group, or subscription scope.
- The user connects with
az ssh vmor another supported Entra-based SSH method; if the user is not in one of those roles, the connection is closed with a permission error.
Even when all of this is configured correctly, the shell inside the VM still runs under a local Linux account name, and whoami will show that local name, not the Entra ID or RBAC role.
References: