Configure managed identities for Azure resources on a VM using the Azure portal
Managed identities for Azure resources is a feature of Azure Active Directory. Each of the Azure services that support managed identities for Azure resources are subject to their own timeline. Make sure you review the availability status of managed identities for your resource and known issues before you begin.
Managed identities for Azure resources provides Azure services with an automatically managed identity in Microsoft Entra ID. You can use this identity to authenticate to any service that supports Microsoft Entra authentication, without having credentials in your code.
In this article, you learn how to enable and disable system and user-assigned managed identities for an Azure Virtual Machine (VM), using the Azure portal.
Prerequisites
- If you're unfamiliar with managed identities for Azure resources, check out the overview section.
- If you don't already have an Azure account, sign up for a free account before continuing.
System-assigned managed identity
In this section, you learn how to enable and disable the system-assigned managed identity for VM using the Azure portal.
Enable system-assigned managed identity during creation of a VM
To enable system-assigned managed identity on a VM during its creation, your account needs the Virtual Machine Contributor role assignment. No other Microsoft Entra directory role assignments are required.
- Under the Management tab in the Identity section, switch Managed service identity to On.
Refer to the following Quickstarts to create a VM:
- Create a Windows virtual machine with the Azure portal
- Create a Linux virtual machine with the Azure portal
Enable system-assigned managed identity on an existing VM
Tip
Steps in this article may vary slightly based on the portal you start from.
To enable system-assigned managed identity on a VM that was originally provisioned without it, your account needs the Virtual Machine Contributor role assignment. No other Microsoft Entra directory role assignments are required.
Sign in to the Azure portal using an account associated with the Azure subscription that contains the VM.
Navigate to the desired Virtual Machine and select Identity.
Under System assigned, Status, select On and then click Save:
Remove system-assigned managed identity from a VM
To remove system-assigned managed identity from a VM, your account needs the Virtual Machine Contributor role assignment. No other Microsoft Entra directory role assignments are required.
If you have a Virtual Machine that no longer needs system-assigned managed identity:
Sign in to the Azure portal using an account associated with the Azure subscription that contains the VM.
Navigate to the desired Virtual Machine and select Identity.
Under System assigned, Status, select Off and then click Save:
User-assigned managed identity
In this section, you learn how to add and remove a user-assigned managed identity from a VM using the Azure portal.
Assign a user-assigned identity during the creation of a VM
To assign a user-assigned identity to a VM, your account needs the Virtual Machine Contributor and Managed Identity Operator role assignments. No other Microsoft Entra directory role assignments are required.
Currently, the Azure portal does not support assigning a user-assigned managed identity during the creation of a VM. Instead, refer to one of the following VM creation Quickstart articles to first create a VM, and then proceed to the next section for details on assigning a user-assigned managed identity to the VM:
- Create a Windows virtual machine with the Azure portal
- Create a Linux virtual machine with the Azure portal
Assign a user-assigned managed identity to an existing VM
To assign a user-assigned identity to a VM, your account needs the Virtual Machine Contributor and Managed Identity Operator role assignments. No other Microsoft Entra directory role assignments are required.
Sign in to the Azure portal using an account associated with the Azure subscription that contains the VM.
Navigate to the desired VM and click Identity, User assigned and then +Add.
Click the user-assigned identity you want to add to the VM and then click Add.
Remove a user-assigned managed identity from a VM
To remove a user-assigned identity from a VM, your account needs the Virtual Machine Contributor role assignment. No other Microsoft Entra directory role assignments are required.
Sign in to the Azure portal using an account associated with the Azure subscription that contains the VM.
Navigate to the desired VM and select Identity, User assigned, the name of the user-assigned managed identity you want to delete and then click Remove (click Yes in the confirmation pane).
Next steps
- Using the Azure portal, give an Azure VM's managed identity access to another Azure resource.
Feedback
Submit and view feedback for