You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Managed identities eliminate the need to store credentials in code, configuration files, or key vaults when Azure resources need to authenticate to other Azure services. They provide an automatically managed identity in Entra ID that your code can use to obtain access tokens without handling secrets.
Consider a web application hosted in Azure App Service that needs to read data from Azure SQL Database. Without managed identities, you would need to:
This creates operational overhead and security risk. Managed identities remove all of these steps.
Azure Resource (e.g., App Service)
|
|-- Requests token from IMDS (http://169.254.169.254/metadata/identity/oauth2/token)
|
v
Azure Instance Metadata Service
|
|-- Authenticates using the managed identity's certificate
|
v
Microsoft Entra ID
|
|-- Returns access token
|
v
Target Service (e.g., Azure SQL, Key Vault, Storage)
| Aspect | System-Assigned | User-Assigned |
|---|---|---|
| Creation | Enabled on a resource | Created as a standalone resource |
| Lifecycle | Tied to the resource | Independent |
| Sharing | One resource only | Multiple resources |
| Use case | Single-resource workloads | Shared workloads, redeployment scenarios |
# Enable on an App Service
az webapp identity assign --name myWebApp --resource-group myResourceGroup
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.