Practice Exams:

Microsoft SC-500: Managed Identities and Least Privilege

Microsoft Security

Managed identities remove reusable application credentials, but secure authentication is only half the design. Azure workloads still need explicit identity selection, narrow authorization and a dependable retirement process. The choice between system-assigned, user-assigned and federated identities affects how applications are deployed, reused and retired. A secure workflow must also verify resource-specific roles, deny unnecessary operations and explain how permission changes are audited and rolled back.

On this page
  1. Choose the identity lifecycle before granting permission
  2. Separate token acquisition from resource authorization
  3. Select the intended identity explicitly at runtime
  4. Federate workload identity outside Azure
  5. Delegate identity attachment and administration separately
  6. Replace avoidable secrets and govern the exceptions
  7. Review idle identities and privilege drift
  8. Test managed identity lifecycle failures

Choose the identity lifecycle before granting permission

A system-assigned managed identity follows the lifecycle of one supported Azure resource. When the resource is deleted, its identity disappears, and a replacement resource usually receives a different principal. That is useful for a single application instance whose identity should not outlive the compute. But an application recreated during a deployment or disaster-recovery test may need its role assignments rebuilt before it can access storage, Key Vault or another dependency.

A user-assigned managed identity has an independent lifecycle and can be attached to multiple supported resources. This can support blue/green deployment or reuse across identical instances, but the identity’s permissions are shared wherever it is attached. Attaching the same identity to two unrelated applications can create accidental trust between them. Choose one coherent business purpose and explicitly record which hosts may use the identity.

Identity design therefore begins with ownership, scope, reuse and retirement. Do not choose user-assigned solely because the deployment template already has one available, or system-assigned merely because it seems simpler in a demo. The expected workload lifecycle determines which form makes least privilege easier to operate over time.

Separate token acquisition from resource authorization

Managed identity enables Azure-hosted code to obtain Microsoft Entra tokens without placing a reusable application password in configuration. The receiving service still decides which operations that identity may perform. A token successfully issued for a storage service does not grant authorization to list every container; the Azure role assignment and service authorization policy must allow the requested action.

Map the exact API operations an application needs. A service that reads blobs may need a data-reader role at the intended scope; it does not necessarily need permission to manage the storage account, change its network rules or create new role assignments. Control-plane roles and data-plane roles are distinct on many Azure services, including Key Vault. Use the smallest built-in role that supports the workload, or justify a narrowly maintained custom role where built-ins grant too much.

Test a negative operation after the happy path succeeds. If the application should only retrieve one secret, try an operation outside that permission and verify it fails. A workload that functions after granting Owner or Contributor at subscription scope proves little about security. For a Key Vault example, see Key Vault access design.

Select the intended identity explicitly at runtime

An Azure resource can support a system-assigned identity alongside one or more user-assigned identities. An SDK or connection configuration that relies on an ambiguous default identity can behave differently after a team attaches a new identity to the host. For predictable production behavior, specify the intended client or resource identity where the platform and Azure Identity library support it.

Keep developer authentication separate from production authentication. Local tests may use an interactive developer session, while deployed code should obtain tokens through the managed identity assigned for that service. A credential-chain fallback that silently uses the wrong principal can conceal missing configuration until the application changes hosts or privileges. Log the identity type and a nonsecret identifier when diagnosing access without writing tokens to logs.

Operationally, treat failed token acquisition and authorization denial as different symptoms. An unavailable metadata endpoint or wrong identity selection is not the same failure as a valid token rejected by the storage service. Clear troubleshooting instructions help teams fix configuration without requesting unnecessarily broad Azure roles.

Use workload federation for jobs outside the Azure host

CI/CD pipelines, GitHub Actions, Kubernetes workloads and other external execution environments may need short-lived tokens without storing application secrets. Workload identity federation creates a trust relationship between a recognized external issuer and an application or managed identity where supported. The relying system evaluates issuer, subject and audience conditions before exchanging a trusted token.

A narrow federated trust is important. If the subject rule matches every repository, branch or workload in an organization, more callers may impersonate the target identity than intended. Review the trust configuration, repository workflow permissions, protected branches and deployment environment constraints as carefully as the Azure resource role assignment.

Do not treat federation as a reason to grant CI/CD the same privilege as the application runtime. A deployment workflow may need to create resources while the application needs only to read data. Separate identities and role scopes prevent a compromised runtime from redeploying its own code and prevent a low-trust build job from gaining broad production resource access.

Delegate identity attachment and administration separately

Azure supports distinct permissions around creating and administering a user-assigned managed identity and attaching it to a supported resource. Separating these duties can help a platform team prepare approved identities and grant a workload team only the ability to attach the identity that belongs to its application.

Treat attachment authority as a privilege. If one highly privileged identity can be attached to an arbitrary VM or function by a broad deployment group, an attacker with deployment access may be able to run code under that identity. Review who can assign the identity to compute and who can grant that identity new Azure roles; both routes can expand access without a password ever being exposed.

A security change record should identify why a shared identity exists, which resources use it, what it can access and which team approves new attachments. The control objective is to prevent an identity created for one service from quietly becoming a reusable administrator for an entire subscription.

Replace avoidable secrets and govern the exceptions

An application that stores a client secret solely to read Key Vault has recreated the credential-management problem it was trying to solve. Where Azure and the downstream service support managed identity, use that path before inventing a secret-distribution mechanism. The workload then receives short-lived tokens and Key Vault data permissions can be limited through Azure RBAC.

Not every external API accepts Microsoft Entra tokens. For a dependency that still requires a certificate or API key, store the credential in an approved secret store, give only the necessary runtime identity retrieval permission, and document rotation, expiry and recovery. A secure architecture can contain a carefully controlled exception without pretending all applications are fully secretless.

The AI workload security problem illustrates why this matters: a model-serving application, search connector and write-capable agent tool may have different credential requirements. Give each component only the authority its call actually needs instead of sharing one broad secret or managed identity across the chain.

Review idle identities and privilege drift

User-assigned identities can outlive the application that originally needed them. A retired container app may disappear while its reusable identity retains Reader, Contributor or data roles on several services. Include owner, attached resources, last observed use, role assignments and federation settings in the identity inventory so cleanup is based on business evidence rather than guesswork.

Changes to an application’s purpose should trigger a privilege review. Adding a reporting feature, new storage account or external integration can lead teams to expand the existing role instead of creating a dedicated access path. Over time that identity can accumulate permissions unrelated to the original job. Use role-review and posture tooling to look for broad scopes and overprivileged principals, and remove stale attachments after migration.

Monitoring should identify material changes in role assignments, managed identity attachments, federation trust and sign-in/token errors. An attacker who compromises a host may use its managed identity even though no secret can be stolen from configuration. The absence of an application password reduces one risk; it does not prevent misuse of the host’s authorized token path.

Test failure, recovery and identity rotation as one workflow

A useful application acceptance test has four parts. The intended runtime can retrieve its required resource; an unrelated operation is denied; rebuilding the compute instance restores the intended identity and roles; and monitoring records both permission changes and failures. Capture the results as deployment evidence rather than a screenshot showing an enabled managed-identity toggle.

For a system-assigned identity, simulate redeployment and verify role assignments are recreated using the new principal. For a user-assigned identity, test that the old compute can be decommissioned without deleting the identity still needed by another approved instance. Finally, remove an unnecessary role and confirm the application continues to work. These tests reveal whether the operating model matches the identity lifecycle decision.

For Microsoft SC-500, the durable design is credential-free authentication with explicitly bounded authorization and a verified ownership lifecycle. Managed identities are most valuable when engineers can explain what the identity can do, where it can run, how it changes and how privilege disappears when the business need ends.

Consider a two-stage deployment that replaces an App Service instance while the backing storage account remains unchanged. With a system-assigned identity, the replacement receives a different principal; the deployment must create a scoped data role for that new principal and revoke the former assignment after migration. With a user-assigned identity, both slots can temporarily share one approved principal, but the team should verify that neither staging nor production gains write access beyond its purpose. In both cases, test an unauthorized data operation, inspect audit logs for the role assignment, and document which identity will be detached or retired after cutover. This converts a conceptual identity choice into a recoverable production procedure.

Related Guides and Official Objectives

Related Posts

• SC-200 Certification: Boost Your Cybersecurity Career

• Exploring the New Microsoft Cybersecurity Tracks: What You Need to Know

• Stepping Into Cybersecurity Leadership — The SC-100 Journey Begins

• Mastering SC-300: Microsoft Identity and Access Administrator

• SC-200: Microsoft Security Operations Analyst Exam Prep

• Microsoft SC-200: KQL for Security Analysts: Ask Better Questions

• Microsoft SC-100: From Business Risk to Cybersecurity Architecture

• Microsoft SC-500: Defender for Servers Design Choices

• Microsoft SC-500: Entitlement Management in Entra ID

• Microsoft SC-500: Entra ID Identity Governance