{"id":4237,"date":"2026-10-12T18:54:14","date_gmt":"2026-10-12T18:54:14","guid":{"rendered":"https:\/\/www.examtopics.info\/blog\/?p=4237"},"modified":"2026-10-22T17:44:49","modified_gmt":"2026-10-22T17:44:49","slug":"microsoft-entra-managed-identities-service-principals","status":"publish","type":"post","link":"https:\/\/www.examtopics.info\/blog\/microsoft-entra-managed-identities-service-principals\/","title":{"rendered":"Microsoft SC-300: Managed Identities and Service Principals"},"content":{"rendered":"<p>A scheduled job that reads a storage account needs an identity, even though no person signs in to run it. The insecure default is often a copied username or long-lived application secret buried in configuration. Microsoft Entra workload identities provide alternatives, but administrators must decide which identity owns the job, how it receives permissions, and what happens when the compute resource is rebuilt or compromised.<\/p>\n<p>The workload-identity part of <a href=\"https:\/\/www.examtopics.info\/sc-300\">Microsoft SC-300<\/a> covers <a href=\"https:\/\/www.examtopics.info\/blog\/microsoft-az-104-managed-identities-for-azure-workloads\/\">managed identities<\/a>, service principals, user accounts, application authentication, permission assignment, and integration with Azure services. The important design question is not simply how to obtain a token. It is how to make the identity lifecycle and authorization boundary match the application lifecycle.<\/p>\n<h2>Choose the identity type from the hosting context<\/h2>\n<p>For an Azure-hosted workload with managed identity support, the identity can eliminate embedded application secrets, while effective authorization at each downstream service must still be checked. Microsoft&#8217;s <a href=\"https:\/\/learn.microsoft.com\/en-us\/entra\/identity\/managed-identities-azure-resources\/overview\" rel=\"nofollow\">managed identities<\/a> documentation distinguishes system-assigned and user-assigned models and describes token acquisition for supported resources. The managed identity still needs explicit authorization to access its target service.<\/p>\n<p>An external workload, a vendor-hosted automation, or an application running outside a supported environment may require a different service principal authentication method. Federated credentials can avoid static secrets in certain supported scenarios, but the trust relationship must be carefully configured. A human user account is generally a poor substitute for a nonhuman workload identity because its password, MFA, employment status, and audit ownership create brittle dependencies.<\/p>\n<p>The selection record should state the host, target resources, required permissions, owner, deployment environment, rotation and recovery method, and expected lifespan. An identity that is perfect for an ephemeral test job may be wrong for a shared integration that must survive a resource replacement.<\/p>\n<h2>Understand system-assigned and user-assigned lifecycles<\/h2>\n<p>A <strong>system-assigned<\/strong> managed identity typically disappears with its Azure resource; a <strong>user-assigned<\/strong> identity is a separate resource that may be reused. Reuse simplifies credential handling but increases the importance of reviewing every resource sharing its access. Creating either identity does not grant Key Vault read permission automatically: token issuance and downstream RBAC authorization must be tested independently.<\/p>\n<p>A system-assigned managed identity is associated with one Azure resource; enabling it creates the identity, and deleting that resource removes the identity. This makes ownership easy to understand but has a consequence: replacing or recreating the resource can change its identity and break target-resource role assignments. Deployment and disaster recovery need to account for that.<\/p>\n<p>A user-assigned managed identity exists as a separate Azure resource and can be assigned to more than one eligible compute resource. It may offer stability across a redeployment or allow a carefully managed shared identity, but sharing also increases the number of workloads that can exercise its permissions. An organization should not create one highly privileged user-assigned identity for all services simply to reduce administration.<\/p>\n<p>Consider a web app that is rebuilt weekly and needs to access a secret store. If the app&#8217;s identity is recreated each week, assignments may require new provisioning steps; a deliberate user-assigned identity can make redeployment more predictable. Conversely, a one-off batch processor may suit a system-assigned identity whose lifetime should end with the job. The correct decision depends on cleanup and blast radius.<\/p>\n<h2>Grant resource permissions separately from authentication<\/h2>\n<p>Receiving a token for an Azure resource does not make that identity an administrator of the resource. For <a href=\"https:\/\/www.examtopics.info\/blog\/microsoft-az-104-azure-rbac-without-role-assignment-confusion\/\">Azure RBAC<\/a>, assign a role at the narrowest practical scope and differentiate control-plane rights from data-plane access. A Storage Blob Data Reader, for example, expresses a different task from a role that manages storage account configuration.<\/p>\n<p>Some services use application-specific access policies or their own data-plane authorization schemes. Before creating a broad subscription role assignment, inspect what the target service actually accepts and how it logs access. A missing data permission should be repaired at the appropriate resource, not by assigning Owner at the subscription level.<\/p>\n<p>The distinction also appears in Azure managed identities for workloads: identity existence, token acquisition, and authorization are three separate checks. Troubleshooting should examine each layer in order, including the target audience, tenant and eventual consistency of a newly granted role.<\/p>\n<h2>Prevent identity reuse from becoming hidden lateral movement<\/h2>\n<p>Multiple services attached to one user-assigned identity share whatever target permissions that identity has. If one service is compromised, it may be able to request tokens and act with the identity&#8217;s authority wherever that authority applies. Use a separate identity when the workloads have different risk profiles, data classifications, or administrators.<\/p>\n<p>Likewise, a service principal granted expansive API application permissions represents a path to data without a user present. Review application permissions, resource roles, secrets, certificates, and federated trust definitions together. The fact that a credential is managed automatically does not eliminate the need to monitor permission changes or unusual behavior.<\/p>\n<p>Provide a named technical owner and a business service owner. The technical team rotates credentials or fixes deployment, while the business owner justifies continued access to the data. Avoid assigning nonhuman accounts to the ordinary employee access-review workflow without a reviewer who understands what the application does.<\/p>\n<h2>Test failure and recovery with a concrete workflow<\/h2>\n<p>Imagine an Azure Function reads messages from a queue and writes objects to a storage container. Record the identities and roles required at both services, then test the function with permissions temporarily withheld in a controlled environment. The resulting error should show whether token acquisition failed, the principal lacked a role, or a network restriction prevented access. Those are different incidents with different fixes.<\/p>\n<p>Recreate the function in a staging subscription and observe what happens to its identity and downstream assignments. Then simulate removal of a user-assigned identity from the host, revocation of a resource role, and temporary target-service unavailability. A secure design should fail closed where appropriate, give a diagnosable error, and have a recovery procedure that does not hand out permanent broad permissions.<\/p>\n<p>Rotation is also operational. External service principals need a schedule for expiring credentials; managed identities remove many such tasks but are still subject to application logic, resource availability, and access governance. Plan safe overlap of old and new credentials where supported and record when the old path has actually stopped being used.<\/p>\n<h2>Map a managed identity across deployment environments<\/h2>\n<p>Production, staging and development environments should normally have separate identities and permissions. If a developer&#8217;s test function can request a token using the same identity as a production service, a staging compromise can become a production data incident. Record which identity belongs to each environment and protect assignment changes in infrastructure-as-code reviews. Avoid storing a production identity&#8217;s client ID as a harmless-looking default across every pipeline.<\/p>\n<p>A resource move or rebuild can change identity attachment and authorization assumptions. For system-assigned identities, confirm the principal ID after the change and reconcile downstream resource roles. For user-assigned identities, confirm the same identity remains attached only where intended; its independent lifecycle makes it easier to retain access after a host disappears. Both require cleanup checks after deployments and decommissions.<\/p>\n<p>When troubleshooting token acquisition, identify the endpoint and mechanism supported by that host rather than embedding credential request logic intended for another platform. Tokens can have caching and lifetime considerations, and a new role assignment may not take effect instantaneously. Distinguish an unavailable metadata or identity endpoint from a valid token with insufficient downstream authorization before changing permissions.<\/p>\n<p>Suppose two Azure Functions use a shared user-assigned identity to reach a storage account. A new application team then attaches that identity to an unrelated function. The change could allow that new workload to access the storage resources without anyone adding a new storage RBAC assignment. An architecture review should therefore examine identity attachment permissions and target resource permissions together.<\/p>\n<p>End each deployment with a short reconciliation: current host-to-identity mapping, required target roles, no extra credential paths, correct log ownership and deletion behavior. A durable workload identity process makes such checks routine in delivery pipelines instead of waiting for an incident to reveal a forgotten service principal.<\/p>\n<p>When authorizing access to a secret store, verify both the service principal&#8217;s authentication path and any resource firewall or private endpoint. A denied request might stem from networking rather than RBAC, and widening permission cannot fix a blocked route. Conversely, opening a firewall path does not authorize the identity. Use one controlled test to demonstrate each boundary independently, and record where operations teams can find identity sign-in evidence and resource-side access logs.<\/p>\n<p>Cross-tenant workload access adds another layer: the resource&#8217;s tenant must understand which external application or federated trust is presented and exactly what resource permissions are granted. Avoid copying role assignments and credential configuration between tenants without reviewing issuer, audience and tenant boundaries. A token issued for one tenant or target resource cannot be assumed valid for another. Production incident runbooks should identify the actual controlling tenant and resource owner before revoking anything.<\/p>\n<h2>Build a workload identity review process<\/h2>\n<p>Inventory service principals and managed identities with owners, last use, permission scopes, high-risk application grants, associated Azure resources, and credential expirations. Monitor risky workload sign-ins when the tenant has the required capabilities, and review unexpected high-privilege role assignments as security events rather than routine configuration noise.<\/p>\n<p>When a team decommissions a service, remove its application permissions and resource role assignments as well as its compute resources. A user-assigned identity may outlive the workload intentionally; if so, that reuse should be recorded, not assumed. Orphaned service principals and credentials create a shadow inventory that attackers can exploit later.<\/p>\n<p>The most robust outcome is a small, explainable authority for each workload, with no unrelated human credential in its execution path. When administrators can identify the service, its permissions, its host, and its failure mode, workload identity becomes an operational control instead of just another client ID in a configuration file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Choose workload identities for Azure services, distinguish system-assigned from user-assigned identities, and govern RBAC and credential lifecycle.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,1],"tags":[],"class_list":["post-4237","post","type-post","status-publish","format-standard","hentry","category-technology-fundamentals","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4237","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=4237"}],"version-history":[{"count":4,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4237\/revisions"}],"predecessor-version":[{"id":5066,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4237\/revisions\/5066"}],"wp:attachment":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/media?parent=4237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/categories?post=4237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/tags?post=4237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}