Managed identities for Azure resources - Managed identities for Azure resources (2024)

  • Article

A common challenge for developers is the management of secrets, credentials, certificates, and keys used to secure communication between services. Managed identities eliminate the need for developers to manage these credentials.

While developers can securely store the secrets in Azure Key Vault, services need a way to access Azure Key Vault. Managed identities provide an automatically managed identity in Microsoft Entra ID for applications to use when connecting to resources that support Microsoft Entra authentication. Applications can use managed identities to obtain Microsoft Entra tokens without having to manage any credentials.

The following video shows how you can use managed identities:

Here are some of the benefits of using managed identities:

  • You don't need to manage credentials. Credentials aren’t even accessible to you.
  • You can use managed identities to authenticate to any resource that supports Microsoft Entra authentication, including your own applications.
  • Managed identities can be used at no extra cost.

Note

Managed identities for Azure resources is the new name for the service formerly known as Managed Service Identity (MSI).

Managed identity types

There are two types of managed identities:

  • System-assigned. Some Azure resources, such as virtual machines allow you to enable a managed identity directly on the resource. When you enable a system-assigned managed identity:

    • A service principal of a special type is created in Microsoft Entra ID for the identity. The service principal is tied to the lifecycle of that Azure resource. When the Azure resource is deleted, Azure automatically deletes the service principal for you.
    • By design, only that Azure resource can use this identity to request tokens from Microsoft Entra ID.
    • You authorize the managed identity to have access to one or more services.
    • The name of the system-assigned service principal is always the same as the name of the Azure resource it is created for. For a deployment slot, the name of its system-assigned identity is <app-name>/slots/<slot-name>.
  • User-assigned. You may also create a managed identity as a standalone Azure resource. You can create a user-assigned managed identity and assign it to one or more Azure Resources. When you enable a user-assigned managed identity:

    • A service principal of a special type is created in Microsoft Entra ID for the identity. The service principal is managed separately from the resources that use it.
    • User-assigned identities can be used by multiple resources.
    • You authorize the managed identity to have access to one or more services.

The following table shows the differences between the two types of managed identities:

PropertySystem-assigned managed identityUser-assigned managed identity
CreationCreated as part of an Azure resource (for example, Azure Virtual Machines or Azure App Service).Created as a stand-alone Azure resource.
Life cycleShared life cycle with the Azure resource that the managed identity is created with.
When the parent resource is deleted, the managed identity is deleted as well.
Independent life cycle.
Must be explicitly deleted.
Sharing across Azure resourcesCan’t be shared.
It can only be associated with a single Azure resource.
Can be shared.
The same user-assigned managed identity can be associated with more than one Azure resource.
Common use casesWorkloads contained within a single Azure resource.
Workloads needing independent identities.
For example, an application that runs on a single virtual machine.
Workloads that run on multiple resources and can share a single identity.
Workloads needing pre-authorization to a secure resource, as part of a provisioning flow.
Workloads where resources are recycled frequently, but permissions should stay consistent.
For example, a workload where multiple virtual machines need to access the same resource.

How can I use managed identities for Azure resources?

You can use managed identities by following the steps below:

  1. Create a managed identity in Azure. You can choose between system-assigned managed identity or user-assigned managed identity.
    1. When using a user-assigned managed identity, you assign the managed identity to the "source" Azure Resource, such as a Virtual Machine, Azure Logic App or an Azure Web App.
  2. Authorize the managed identity to have access to the "target" service.
  3. Use the managed identity to access a resource. In this step, you can use the Azure SDK with the Azure.Identity library. Some "source" resources offer connectors that know how to use Managed identities for the connections. In that case, you use the identity as a feature of that "source" resource.

What Azure services support the feature?

Managed identities for Azure resources can be used to authenticate to services that support Microsoft Entra authentication. For a list of supported Azure services, see services that support managed identities for Azure resources.

Which operations can I perform on managed identities?

Resources that support system assigned managed identities allow you to:

  • Enable or disable managed identities at the resource level.
  • Use role-based access control (RBAC) to grant permissions.
  • View the create, read, update, and delete (CRUD) operations in Azure Activity logs.
  • View sign in activity in Microsoft Entra ID sign in logs.

If you choose a user assigned managed identity instead:

  • You can create, read, update, and delete the identities.
  • You can use RBAC role assignments to grant permissions.
  • User assigned managed identities can be used on more than one resource.
  • CRUD operations are available for review in Azure Activity logs.
  • View sign in activity in Microsoft Entra ID sign in logs.

Operations on managed identities can be performed by using an Azure Resource Manager template, the Azure portal, Azure CLI, PowerShell, and REST APIs.

Next steps

  • Developer introduction and guidelines
  • Use a VM system-assigned managed identity to access Resource Manager
  • How to use managed identities for App Service and Azure Functions
  • How to use managed identities with Azure Container Instances
  • Implementing managed identities for Microsoft Azure Resources
  • Use workload identity federation for managed identities to access Microsoft Entra protected resources without managing secrets
Managed identities for Azure resources - Managed identities for Azure resources (2024)

FAQs

What are managed identities for Azure resources? ›

Managed identities for Azure resources provide 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.

What are the 3 main identity types used in Azure AD? ›

Azure AD manages different types of identities:
  • User. User identity is a representation of something that's Azure AD manages. ...
  • Service principal. A service principal is a secure identity that enables an application or service to access Azure resources. ...
  • Managed identity. ...
  • Device.

What is the difference between managed identity and service identity? ›

Service Principal and Managed Identity are both tools for Azure identity management. However, their ideal usage differs. Service Principal is great for apps that need specific access and control. Whereas Managed Identity is good when you want Azure to handle the login details automatically.

Why do we need managed identity in Azure? ›

A managed identity from Microsoft Entra ID allows your app to easily access other Microsoft Entra protected resources such as Azure Key Vault. The identity is managed by the Azure platform and does not require you to provision or rotate any secrets.

What is the limit of managed identity in Azure? ›

Requests to the Managed Identity category are limited to 20 requests per second and 5 concurrent requests. You can read more at the Azure Instance Metadata Service (Windows) article.

How do managed identities authenticate? ›

Managed Identities solve this problem by creating an identity for the Azure resource itself (such as a Virtual Machine or an Azure Function). This identity is then used to authenticate and obtain access tokens to interact with other Azure services that support Azure Active Directory (Azure AD) authentication.

What is identity management in Azure AD? ›

Azure AD is a highly-available and highly-scalable identity management service for small and large organizations. It enables organizations to use their corporate credentials to authenticate to new or existing applications, factoring out the authentication process and eliminating the need for many different identities.

Which three tasks can be performed by using Azure Identity Protection? ›

Detection and mitigation of identity-based risks without human intervention. Conducting risk analysis. Export information about the security risks to third-party tools for deeper analysis.

What is managed identity between Azure functions? ›

In the Azure portal, go to your Azure function. Under Account Settings, select Identity. Select the User assigned tab, and then select Add. Select your existing user-assigned managed identity, and then select Add.

Where are device identities managed in Azure? ›

Microsoft Entra ID provides a central place to manage device identities and monitor related event information. You can access the devices overview by completing these steps: Sign in to the Microsoft Entra admin center as a user with at least default user permissions. Go to Identity > Devices > Overview.

What are the different identities in Azure? ›

There are two types of managed identities:
  • System-assigned. Some Azure resources, such as virtual machines allow you to enable a managed identity directly on the resource. When you enable a system-assigned managed identity: ...
  • User-assigned. You may also create a managed identity as a standalone Azure resource.
Oct 23, 2023

What is the default managed identity? ›

The default managed identity is the system-assigned managed identity or the first user-assigned managed identity. During a run there are two applications of an identity: The system uses an identity to set up the user's storage mounts, container registry, and datastores.

What is Azure managed identities and service principals? ›

About service principals and managed identities

Managed identities is another Microsoft Entra feature that acts similarly to an application's service principals. These objects provide identities for Azure resources and allow an easy way for services that support Microsoft Entra authentication to share credentials.

What is managed identity in Azure App Service? ›

Managed identity is one of unique functionalities in Azure and it allows us to authenticate callers and configure RBAC against called resources without storing caller credentials.

What is identity management service in Azure? ›

Microsoft identity and access management solutions help IT protect access to applications and resources across the corporate datacenter and into the cloud. Such protection enables additional levels of validation, such as multifactor authentication and Conditional Access policies.

Top Articles
Latest Posts
Article information

Author: Kareem Mueller DO

Last Updated:

Views: 6431

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Kareem Mueller DO

Birthday: 1997-01-04

Address: Apt. 156 12935 Runolfsdottir Mission, Greenfort, MN 74384-6749

Phone: +16704982844747

Job: Corporate Administration Planner

Hobby: Mountain biking, Jewelry making, Stone skipping, Lacemaking, Knife making, Scrapbooking, Letterboxing

Introduction: My name is Kareem Mueller DO, I am a vivacious, super, thoughtful, excited, handsome, beautiful, combative person who loves writing and wants to share my knowledge and understanding with you.