Managed Identity
Problem
- Your ASP.NET Core app loads its database connection string from Azure Key Vault.
- To reach Key Vault at all, the app first authenticates with a client secret stored in its own configuration.
- That secret is a real credential sitting in a config file. If it leaks, whoever has it can open Key Vault too.
The app needs a secret just to prove it's allowed to ask for other secrets.
Solution
Managed Identity
- Turn on a managed identity for the app in Azure.
- Azure itself becomes the app's identity; there is no secret for the app to hold at all.
- Key Vault is told to trust that managed identity directly.
Azure vouches for the app. There's no secret left to leak, because there's no secret left to hold.
Analogy
A hotel guest checks in, and the front desk issues a keycard that opens exactly one room.
The guest never carries a copy of the master key. The hotel's own system recognizes the card and vouches for it at every door.
A managed identity is that keycard: Azure vouches for the app directly, so there's no master key for the app to carry or lose.