A managed identity gives an Azure resource an Azure AD identity for accessing supported cloud services without storing or managing passwords and certificates. It replaces the credential-handling burden of a service principal, reducing the risk that application secrets are exposed on resources or in source control. section 2.1.4 section 2.1.5
Choose the identity type by its lifetime and reuse needs:
- System-assigned identities are tied to one Azure resource and are suited to that resource’s access to supported services. section 2.1.5
- User-assigned identities are standalone Azure resources that multiple Azure resources can use. section 2.1.5
- For large VM deployments, use a user-assigned identity to avoid creating one system-assigned identity per VM. section 9.1.4
Create a user-assigned identity in a resource group, then grant it permissions to the Azure resources it must access. The target service must support managed identities, and access should follow least privilege through Azure RBAC roles and scopes. section 2.1.6 section 2.3.2 section 2.14
Use this Azure CLI command in Cloud Shell to create a user-assigned identity; supply the identity name and destination resource group. section 2.1.6
App Service and VM operations
An App Service web application can use a managed identity to access Azure Storage without managed secrets. When installing Azure Monitor Agent across many VMs, a user-assigned identity can be shared; a system-assigned identity remains tied to each VM. section 4.5 section 9.1.4


