Azure Managed Identities
What you'll learn: How Azure resources can authenticate themselves automatically without storing credentials in your code.
The Problem with Credentials
Imagine your web application needs to read secrets from Azure Key Vault. Traditionally, you'd store a username and password (or access key) somewhere in your app's configuration. But who protects those credentials? It's a chicken-and-egg problem that creates security risks.
What Are Managed Identities?
Managed identities are Azure's solution: they give your Azure resources (like Virtual Machines, App Services, or Functions) an automatic identity in Azure Active Directory. These identities can authenticate to other Azure services without you managing any credentials at all. Azure handles the entire lifecycle behind the scenes.
System-Assigned vs User-Assigned
Azure offers two types:
System-assigned managed identities are tied directly to a single Azure resource. When you enable it on a VM, Azure creates an identity that lives and dies with that VM. Think of it like a built-in employee badge that's destroyed when someone leaves the company.
User-assigned managed identities are standalone resources you create once and can assign to multiple Azure resources. It's like a shared service account badge that multiple team members can use. You manage its lifecycle independently—delete the VM, but the identity persists.
How It Works
When your resource needs access, it requests a token from Azure's metadata service using its managed identity. Azure verifies the identity and issues a temporary token to access the target service (like Key Vault or Storage). No passwords stored anywhere!
Key Takeaway: Managed identities eliminate credential management for Azure resources—system-assigned identities live with one resource, while user-assigned identities can be shared across multiple resources.