How to: Use Managed Service Identities

Learn how to use Managed Service Identities

Using MSI, authentication happens automatically by virtue of your application running on top of an Azure service that has an assigned identity.

For example, let’s say you enable a managed service identity for an Azure VM, Azure Container App, or an Azure Kubernetes Service cluster. When you do, an Azure AD application is created for you and automatically assigned to the service. Your Dapr services can then leverage that identity to authenticate with Azure AD, transparently and without you having to specify any credential.

To get started with managed identities, you need to assign an identity to a new or existing Azure resource. The instructions depend on the service use. Check the following official documentation for the most appropriate instructions:

After assigning a managed identity to your Azure resource, you will have credentials such as:

  1. {
  2. "principalId": "<object-id>",
  3. "tenantId": "<tenant-id>",
  4. "type": "SystemAssigned",
  5. "userAssignedIdentities": null
  6. }

From the returned values, take note of principalId, which is the Service Principal ID that was created. You’ll use that to grant access to Azure resources to your Service Principal.

Next steps

Refer to Azure component specs >>

Last modified June 19, 2023: Merge pull request #3565 from dapr/aacrawfi/skip-secrets-close (b1763bf)