Understanding Azure Managed Identities: System-Assigned vs User-Assigned
Compare system-assigned and user-assigned managed identities by configuring both on Azure VMs to securely access Key Vault and Storage.

Lab overview
Azure managed identities eliminate the need for developers and administrators to manage credentials by providing an automatically managed identity in Microsoft Entra ID. This identity can be used to authenticate to any service that supports Entra authentication without storing passwords, keys, or certificates in code or configuration.
There are two types of managed identities: system-assigned, which is tied to the lifecycle of a single Azure resource and is automatically created and deleted with that resource, and user-assigned, which is created as a standalone Azure resource and can be shared across multiple resources with an independent lifecycle.
In this lab, you will work with both types side by side. You will enable a system-assigned managed identity on a virtual machine and grant it access to an Azure Key Vault. Then, you will create a user-assigned managed identity, assign it to a second virtual machine, and grant it access to an Azure Storage Account. By comparing both approaches, you will understand when to use each type and how Azure RBAC role assignments connect identities to the resources they need to access.
Objectives
Upon completing this intermediate level lab, you will be able to:
- Explain the differences between system-assigned and user-assigned managed identities, including lifecycle, scope, and use cases
- Enable a system-assigned managed identity on an Azure Virtual Machine
- Create a user-assigned managed identity as a standalone Azure resource and assign it to a Virtual Machine
- Configure Azure RBAC role assignments to grant a managed identity access to Azure Key Vault
- Configure Azure RBAC role assignments to grant a managed identity access to Azure Storage
- Verify that each managed identity can authenticate and access its target resource without credentials
Who is this lab for?
This lab is designed for:
- Cloud engineers and administrators who need to implement secure, credential-free authentication between Azure resources
- Security-focused practitioners looking to reduce secret sprawl and adopt zero-trust identity patterns in their Azure environments
Basic familiarity with the Azure Portal, Azure Virtual Machines, and the concept of role-based access control (RBAC) is recommended.
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.
More labs like this
Access Azure Key Vault Secrets from a Web App Using Managed Identity
Enable a system-assigned managed identity on App Service and use the Azure SDK to securely retrieve secrets from Key Vault.
Securing Azure Web Apps with Managed Identity and Key Vault
Store application secrets in Azure Key Vault and configure Managed Identity to securely retrieve them from App Service without exposing credentials.
Implement Network Security Groups (NSGs) and Application Security Groups (ASGs) in Azure
Secure Azure VMs using Network Security Groups and Application Security Groups. Create rules, control traffic flow, and implement least privilege access.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Logging into Azure Account using Azure Portal
- 02
Explore Pre-Provisioned Resources For Managed Identity
1 automated check
- 03
Enable a System-Assigned Managed Identity on Azure Virtual Machine
1 automated check
- 04
Grant the System-Assigned Identity Access to Key Vault
1 automated check
- 05
Create and Assign a User-Assigned Managed Identity to Azure VM
2 automated checks
- 06
Grant the User-Assigned Identity Access to Storage
1 automated check
Skills validated
Not the lab you were looking for?
Browse 250+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.