{"id":3536,"date":"2026-10-08T11:48:50","date_gmt":"2026-10-08T11:48:50","guid":{"rendered":"https:\/\/www.examtopics.info\/blog\/microsoft-az-104-managed-identities-for-azure-workloads\/"},"modified":"2026-10-08T11:48:50","modified_gmt":"2026-10-08T11:48:50","slug":"microsoft-az-104-managed-identities-for-azure-workloads","status":"publish","type":"post","link":"https:\/\/www.examtopics.info\/blog\/microsoft-az-104-managed-identities-for-azure-workloads\/","title":{"rendered":"Microsoft AZ-104: Managed Identities for Azure Workloads"},"content":{"rendered":"<h2>Microsoft AZ-104: Managed Identities for Azure Workloads<\/h2>\n<p>Managed identities let Azure workloads authenticate to services that support Microsoft Entra ID without storing an application password, certificate, or account key in code. Azure creates and manages the identity relationship, the workload requests a token at runtime, and the destination service authorizes that identity according to its assigned permissions. The result is a credential model that is easier to rotate, audit, and protect than embedded secrets.<\/p>\n<p>For <a href=\"https:\/\/www.examtopics.info\/az-104\">AZ-104<\/a>, managed identity connects identity administration to workload operations. In real environments, the design question is not merely how to turn the feature on. Administrators must choose system-assigned or user-assigned identity, grant least privilege, understand lifecycle, and troubleshoot token and role-assignment behavior.<\/p>\n<h3>Managed identity replaces stored credentials with an Azure identity<\/h3>\n<p>Traditional application authentication often begins with a client ID and a secret or certificate. The application stores that credential somewhere, someone must rotate it, and every copy becomes a security risk. Managed identity removes the need for the workload to manage that credential directly. Azure exposes an identity endpoint or platform integration that can issue Microsoft Entra access tokens to the workload.<\/p>\n<p>The token is still scoped to a destination resource. A VM, App Service, Function, or other supported Azure resource can request a token for Azure Storage, Key Vault, SQL, or another service that accepts Entra authentication. The destination then evaluates the identity\u2019s permissions. Managed identity therefore solves authentication credential management; it does not automatically grant authorization.<\/p>\n<p>This is why RBAC remains central. Enabling an identity creates or associates the principal, but a separate role assignment is usually required at the target service. The identity should receive only the actions and scope the workload genuinely needs.<\/p>\n<p>Token audience is an important detail. A token issued for Azure Storage cannot simply be presented to Key Vault, because each service validates the intended resource or scope. Supported Azure SDKs handle this by requesting tokens for the service being called. When a custom client receives an authentication error despite a valid-looking token, confirm that the token was requested for the correct destination before changing role assignments.<\/p>\n<h3>System-assigned identities share the resource lifecycle<\/h3>\n<p>A system-assigned managed identity is enabled directly on one Azure resource. Azure creates the corresponding service principal, and the identity\u2019s lifecycle is tied to that resource. When the resource is deleted, the system-assigned identity is deleted as well. The identity cannot simply be attached to a second resource as a shared principal.<\/p>\n<p>This can be a clean design when one resource needs its own unique access. The ownership relationship is obvious, and removing the resource also removes the identity. It is useful for workloads where one compute instance or application should have permissions that no sibling resource shares.<\/p>\n<p>The lifecycle coupling can complicate automated deployment when role assignments must exist before the workload is recreated. A newly created system-assigned identity receives a new principal, so deployment code may need to wait for identity creation and then create the downstream role assignment. This is one reason Microsoft recommends user-assigned identities for many broader scenarios.<\/p>\n<p>The lifecycle tie is useful during cleanup because deleting the resource removes the identity object that existed only for that workload. However, downstream role assignments can become stale references when resources are repeatedly recreated. Deployment and governance tooling should remove obsolete assignments and not assume that a new resource with the same name has the same principal ID as the resource it replaced.<\/p>\n<h3>User-assigned identities are reusable Azure resources<\/h3>\n<p>A user-assigned managed identity is created as its own Azure resource and can be associated with multiple supported compute resources. Its lifecycle is independent of those resources. You can create the identity first, assign permissions to it, and then attach it to workloads as part of deployment.<\/p>\n<p>Microsoft currently recommends user-assigned managed identities for most scenarios because they reduce repeated identity and role-assignment administration and allow permissions to be prepared before compute exists. A shared identity can be appropriate when several resources intentionally require the same downstream access.<\/p>\n<p>Reuse should still follow least privilege. Sharing one identity across unrelated applications because it is convenient increases the blast radius: every resource using the identity gains the permissions assigned to it. Create separate identities when workloads have meaningfully different security boundaries or when you need independent auditing and revocation.<\/p>\n<p>Reusability also enables blue-green or scale-out deployment patterns. New compute instances can attach the existing identity and receive the same downstream access without creating a new principal for every instance. That can simplify role-assignment limits and operational review. The security team should still know every resource allowed to attach the identity, because each one effectively gains the identity\u2019s permissions.<\/p>\n<h3>Client ID and principal ID serve different purposes<\/h3>\n<p>A user-assigned managed identity has identifiers that are easy to confuse. The client ID identifies the application identity when a workload or SDK needs to select which user-assigned identity should be used. The principal ID identifies the service principal object in Microsoft Entra ID and is commonly used when assigning Azure roles.<\/p>\n<p>Using the wrong identifier can cause automation failures that look like missing permissions. A deployment may successfully attach the identity to a resource but fail when the RBAC step tries to assign a role to an object that Azure cannot resolve. Infrastructure code should name the identifier explicitly rather than using a generic variable called <code>id<\/code>.<\/p>\n<p>The identity administration concepts overlap with <a href=\"https:\/\/www.examtopics.info\/sc-300\">SC-300<\/a>. An overview of the <a href=\"https:\/\/www.examtopics.info\/blog\/the-sc-300-microsoft-identity-and-access-administrator-certification\/\">Microsoft identity and access administrator<\/a> role provides broader context for service principals, groups, authentication, and governance, while managed identity applies those principles to Azure-hosted workloads.<\/p>\n<p>The full Azure resource ID is a third identifier that appears in templates and resource associations. It identifies the user-assigned identity resource inside Azure Resource Manager, while the client and principal IDs identify aspects of its Entra application\/service-principal representation. Clear variable names such as <code>identityResourceId<\/code>, <code>clientId<\/code>, and <code>principalId<\/code> prevent a surprising number of deployment errors.<\/p>\n<h3>Authorization should be narrow and attached to the target resource<\/h3>\n<p>Managed identity is most valuable when it eliminates secrets without replacing them with broad privilege. If a web application only needs to read one Key Vault or one storage container, grant the identity the smallest built-in role and practical scope that supports that operation. Avoid subscription Contributor because it is easy to assign.<\/p>\n<p>Data-plane roles matter. A managed identity that needs blob data should receive an appropriate Storage Blob Data role; permission to configure the storage account is not the same as permission to read data through Microsoft Entra authorization. Key Vault, databases, Service Bus, and other services have their own access models and supported roles.<\/p>\n<p>Review inherited permissions too. A role assigned at a subscription or resource group can make the identity far more powerful than the workload designer intended. The effective authorization is the sum of applicable assignments, so least privilege requires understanding the full scope hierarchy.<\/p>\n<p><strong>Secretless authentication improves credential hygiene, but it does not remove dependency risk.<\/strong><\/p>\n<p>Eliminating an application secret removes rotation failures, secret leakage, and many deployment-time credential problems. It also creates a dependency on Microsoft Entra token issuance and the target service\u2019s support for Entra authentication. Workloads should handle token acquisition errors and service unavailability according to their reliability requirements.<\/p>\n<p>Applications should use supported Azure Identity libraries or service integrations rather than manually calling identity endpoints unless there is a specific need. Those libraries handle token caching and selection patterns that would otherwise be easy to implement incorrectly. They also make local development easier by supporting developer credentials while the deployed workload uses managed identity.<\/p>\n<p>A general view of <a href=\"https:\/\/www.examtopics.info\/blog\/understanding-the-role-of-a-microsoft-azure-administrator\/\">Azure administration<\/a> helps explain why identity is only one layer. The workload still depends on networking, DNS, target service health, RBAC, and resource configuration. Secretless authentication simplifies one critical part of the path without eliminating the need to operate the rest.<\/p>\n<p>Separate identities can also express different privilege levels within one application. A frontend that reads configuration does not need the same identity as a background worker that writes to a queue or database. Using one identity for every component simplifies configuration but combines their blast radius. Split identities when the authorization differences are meaningful enough to improve containment and auditability.<\/p>\n<h3>Infrastructure as code benefits from pre-created user-assigned identity<\/h3>\n<p>User-assigned identity fits predictable deployment pipelines because the identity and its role assignments can exist before an application resource is created. A platform team can provision the identity at an approved scope, grant required permissions, and allow an application deployment to attach it without granting that deployment pipeline permission to create new role assignments.<\/p>\n<p>This separation can reduce privileged deployment rights. The team that creates compute only needs permission to associate an existing user-assigned identity, while a security or platform process controls what the identity itself can access. It also avoids the race in which a system-assigned identity must first be created before its principal ID is available for RBAC.<\/p>\n<p>Automation guidance in <a href=\"https:\/\/www.examtopics.info\/blog\/6-game-changing-devops-tools-for-azure-devops-professionals\/\">Azure DevOps tooling<\/a> is relevant because identity should be part of deployment architecture, not a manual portal step. Repeatable role assignment and identity attachment reduce configuration drift between environments.<\/p>\n<p>Role-assignment creation itself requires privilege, so pipeline design should avoid giving every application deployment the ability to grant arbitrary Azure roles. A platform pipeline can create the identity and approved assignments, while the application pipeline receives only permission to deploy compute and attach that identity. This separation makes the desired access reviewable as code without turning the deployment runner into a subscription-level access administrator.<\/p>\n<h3>Permission changes and token caching can delay expected behavior<\/h3>\n<p>Managed identity tokens are cached by Azure infrastructure for performance and resiliency. Microsoft notes that group or role membership changes reflected in token claims can take hours to appear for managed identities in some scenarios because an existing token cannot simply be forced to refresh immediately. This matters when teams grant access and expect an application to recognize it instantly.<\/p>\n<p>Direct role assignments to a user-assigned managed identity can be more predictable than using Microsoft Entra group membership as the primary mechanism for rapidly changing workload permissions. The exact propagation time still depends on the service and authorization layer, so deployment runbooks should allow for eventual consistency instead of repeatedly widening access when a new permission appears delayed.<\/p>\n<p>Troubleshooting should record when the role was assigned, which identity the application is actually using, and which token audience or resource it requested. \u201cManaged identity is enabled\u201d is not enough evidence that the current process is using the expected principal.<\/p>\n<p>Design emergency revocation with that caching behavior in mind. If a compromised workload uses a managed identity, removing a group membership may not invalidate cached tokens immediately. Disabling the resource, removing the identity association, changing a direct target-service assignment, or using service-specific controls may provide a faster containment path depending on the incident. Runbooks should reflect the actual authorization and token layers in use.<\/p>\n<h3>Troubleshoot identity, token, network, and authorization separately<\/h3>\n<p>Start by confirming that the Azure resource has the intended system-assigned or user-assigned identity attached. If multiple user-assigned identities are present, verify that the application selects the expected client ID. Then test whether the workload can obtain a token for the correct resource audience.<\/p>\n<p>If token acquisition succeeds but the service rejects the request, inspect the target service\u2019s RBAC or access configuration. Confirm the role, scope, and principal ID, and allow for propagation. If the request cannot reach the target at all, troubleshoot DNS, private endpoints, firewalls, or routing separately; managed identity cannot overcome a blocked network path.<\/p>\n<p>This layered approach prevents unnecessary secret fallbacks. Teams sometimes abandon managed identity after one authorization error and reintroduce an account key. A better response is to identify which layer failed and correct it while keeping the secretless model intact.<\/p>\n<p>Logs can help distinguish the layers. Microsoft Entra sign-in information can show managed-identity authentication activity, Azure Activity logs can show identity attachment and role-assignment changes, and the destination service may log authorization failures. Correlating those sources is more reliable than treating a generic 403 as proof that the identity does not exist.<\/p>\n<h3>A managed identity should represent a clear workload security boundary<\/h3>\n<p>The final design question is ownership. Which application or set of resources is allowed to act as this identity, what resources may it access, and who can attach it to new compute? User-assigned identities are reusable, which makes the permission to assign them sensitive. Anyone who can attach a powerful identity to a resource may gain an indirect path to its downstream privileges.<\/p>\n<p>Use separate identities when applications have different trust levels, assign roles at narrow target scopes, and control who can attach user-assigned identities. Review unused identities and stale role assignments as part of lifecycle management. When a workload is retired, remove access even if the user-assigned identity remains for another service.<\/p>\n<p>Managed identities are strongest when they eliminate credentials and make authorization explicit. Choose system-assigned identity for a tightly coupled one-resource lifecycle when that model fits. Prefer user-assigned identity for reusable, pre-provisioned, and centrally managed access. In both cases, least privilege and clear ownership matter more than the convenience of turning identity on.<\/p>\n<p>Finally, govern the permission to assign user-assigned identities. An identity with powerful Key Vault or storage access is effectively a capability that can be transferred to any resource an operator is allowed to attach it to. Azure roles such as Managed Identity Operator and resource-specific permissions should be scoped carefully so that convenience does not create an indirect privilege-escalation path.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft AZ-104: Managed Identities for Azure Workloads Managed identities let Azure workloads authenticate to services that support Microsoft Entra ID without storing an application password, certificate, or account key in code. Azure creates and manages the identity relationship, the workload requests a token at runtime, and the destination service authorizes that identity according to its [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,1],"tags":[],"class_list":["post-3536","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/3536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/comments?post=3536"}],"version-history":[{"count":0,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/3536\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/media?parent=3536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/categories?post=3536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/tags?post=3536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}