Introduction

Azure Active Directory provides managed identities for Azure resources. Each Azure service that supports managed identities for Azure resources has its own release schedule.

Managed identities for Azure resources provide Azure services with an Azure Active Directory identity that is automatically managed. Without needing to include credentials in your code, you may use this identity to authenticate to any service that supports Azure AD authentication.

The following are some of the advantages of using managed identities:

  • You do not need to make note of credentials. You don't even have access to credentials.
  • Managed identities can be used to authenticate into any resource that accepts Azure AD authentication, including your own apps.
  • It would not be essential to spend more to use managed Identities.

 Types of Managed identity

  •  System Assigned Managed Identity
  • User Assigned Managed Identity

 

System Assigned Managed Identity

You can enable a managed identity directly on a service instance inside some Azure services. An identity is created in Azure AD when you enable a system-assigned managed identity. The identity is linked to the service instance's lifecycle. When you destroy a resource, Azure immediately deletes your identity. By design, this identity can only be used to request tokens from Azure AD by that Azure resource.

During the creation of a Virtual Machine, enable system-assigned managed identity.

Following these steps,

Go to the Azure portal and log in.

Create a new virtual machine

Switch Managed service identity to On in the Identity section of the Management tab.



 On an existing Virtual Machine, enable system-assigned managed identity.

Go to the Azure portal and log in.

Open in the existing Virtual Machine

Select and open the identity option.

Select the System assigned option.

Applied for the Status On and save it.



 Remove the system-assigned managed identity.

Go to the Azure portal and log in.

Open in the existing Virtual Machine

Select and open the identity option.

Select the System assigned option.

Applied for the Status Off and save it.



User assigned Managed Identity

A managed identity can also be created as a stand-alone Azure resource. A user-issued managed identity can be created and assigned to one or more Azure service instances. The identity is handled independently from the resources that use it for user-assigned managed identities.

On an existing Virtual Machine, enable user-assigned managed identity.

Go to the Azure portal and log in.

Open in the existing Virtual Machine

Select and open the identity option.

Select the User assigned option.

Select +Add option.


Add the user assigned managed identities.


If need to remove the option:

Select and Remove User assigned managed identities

 

 

 

Summary

In this article, I showed you How to deploy the managed identities for Azure resources on a VM using the Azure portal.