> From service account to workload identity: design the transition, not just the target architecture | Wieger Bosgraaf
    All insights

    Identity & Security

    From service account to workload identity: design the transition, not just the target architecture

    A more secure workload identity does not guarantee a safe migration. Design the transition alongside the target architecture and prove capability, authorization, monitoring and continuity before cutover.

    Wieger Bosgraaf · 9 min read

    Published

    A more secure identity is not automatically a safe transition

    Using an interactive user account for automation is increasingly at odds with modern Microsoft 365 security principles. Software should authenticate as software wherever the runtime and target resource support it.

    Microsoft Entra offers service principals, managed identities and federated trust for workload authentication. These can improve security, but selecting a new identity type does not demonstrate that existing automation will survive migration.

    My design principle is straightforward: identity modernization needs two designs. A target architecture defines the desired security posture. A transition architecture shows how to get there without losing capabilities, control or business continuity.

    Why legacy service accounts persist

    Service accounts frequently reflect historical constraints rather than a deliberate decision to accept risk. Older PowerShell modules, migration tools and integrations were sometimes built around a signed-in user and its implicit authorization context.

    Over time, the same account may become a dependency of scripts, scheduled jobs, integrations, operational procedures and recovery routines. Replacing its credentials without discovering those dependencies pushes uncertainty into the production cutover.

    The first deliverable should therefore be a dependency inventory, not an app registration: which workloads use the identity, what do they execute, who owns them and what happens when they fail?

    Service principals, managed identities and federation are distinct

    A traditional service account is often a user object used by software. An app registration defines an application in Microsoft Entra; a service principal is its representation in a tenant. A managed identity uses a Microsoft-managed service principal so supported Azure workloads do not manage their own long-lived credentials.

    For suitable Azure runtimes, a managed identity is often the preferred option. Elsewhere, certificate-based application authentication or workload identity federation may be appropriate. Federation establishes trust in an external identity provider's token rather than storing a long-lived client secret.

    Choose based on the actual runtime and target resource. Not every API, tool or platform supports every authentication flow, and a service principal does not imply least privilege without carefully scoped authorization.

    Changing authentication can change authorization

    Delegated permissions involve an application acting on behalf of a signed-in user. App-only access has no user context: the application acts under its own identity and relies on application permissions or workload-specific resource authorization.

    These models cannot be treated as interchangeable credentials. An operation might require user context, an API might lack an application permission for a particular operation, and workloads may add their own RBAC controls.

    For example, a job that combines Microsoft Graph with Exchange Online PowerShell crosses multiple authorization surfaces. Exchange supports app-only PowerShell and RBAC for Applications, both of which need explicit design and validation.

    Rather than copying the old account's privileges, identify the exact actions the workload must perform. Modernizing authentication is an opportunity to redesign the access model.

    Prove capability parity before cutover

    A more secure authentication method says nothing about functional equivalence. Five dimensions of parity should therefore be demonstrated for the actual production workload, not only for a token request in a development environment.

    Test the real API operations, module versions, hosting runtime, schedules, error paths and permissions. A proof of concept can demonstrate feasibility but is not sufficient production acceptance.

    CheckEvidence required
    Authentication parityThe workload reliably obtains tokens in its real runtime.
    Capability parityEvery required action works using supported app-only APIs, modules and tools.
    Authorization parityPermissions cover required actions without unnecessary tenant-wide access.
    Operational parityScheduling, logging, error handling, ownership and support remain workable.
    Recovery parityA credible failure scenario and controlled restoration have been tested.

    Design both the target and transition architectures

    The target architecture specifies the lasting design: workload identity, authentication, least-privilege permissions, credentials, lifecycle, monitoring and operational ownership.

    The transition architecture describes dependencies, capability validation, temporary coexistence, test evidence, cutover criteria, recovery and a deadline for retiring the previous access path.

    This is not a Microsoft product feature. It is an architectural distinction that makes the gap between a secure target state and a safe implementation explicit.

    Use an evidence-based transition gate

    I use nine gates to connect the target design to a production cutover. This is a practical architecture review framework rather than a Microsoft certification or a vendor-prescribed checklist.

    Each gate calls for verifiable evidence. The level of rigor should match the workload's criticality and risk. Critical gaps mean the cutover is not yet ready.

    GateMinimum evidence
    1. DependenciesInventory of jobs, scripts, tools, connected systems and accountable owners.
    2. Target identityDocumented identity, trust and authentication design.
    3. CapabilitySuccessful tests for required API, module and tool operations.
    4. AuthorizationDocumented minimum app roles, RBAC assignments and resource scopes.
    5. CredentialsControlled credential model, minimizing long-lived secrets.
    6. ObservabilityAvailable sign-in and process logs, alerting and operational follow-up.
    7. ContinuityTested cutover runbook, acceptance criteria and decision ownership.
    8. RecoveryValidated recovery or rollback path with a time limit.
    9. RetirementOwnership, criteria and deadline for disabling the legacy identity.

    Test in the real execution environment

    A local script obtaining an access token validates only one link in the chain. Production acceptance must address actual transactions, permissions, runtime conditions, throttling, time-outs, dependencies and failure paths.

    Each test should record the identity, target resource, expected result and observable outcome. High-impact jobs require explicit technical acceptance before cutover.

    Parallel operation is useful only when duplicate execution is safe. For write operations, shadow testing, test datasets or a staged cutover may be safer than concurrent production writers.

    Monitoring, recovery and retirement belong in the design

    Microsoft Entra provides sign-in logs for service principals and managed identities. Successful authentication does not prove successful task execution, so combine identity telemetry with process outcomes, error signals and operational ownership.

    Rollback should be designed in advance rather than improvised after failure. Temporarily retaining the old identity may be justified, provided it has an owner, an explicit end date and controls against prolonged privilege exposure.

    Migration is not complete when the new identity first works. It is complete when the new workload is demonstrably stable and the legacy identity, credentials and remaining permissions can safely be removed.

    Entra controls also differ by identity type and licensing. For example, Conditional Access for workload identities is not directly applied to managed identities in the same way. Verify the actual controls available to your chosen implementation.

    What technical leadership must bring together

    A single workload may authenticate through Microsoft Entra, call Microsoft Graph, administer Exchange Online and be operated by another platform team. Its dependencies cross product and organizational boundaries.

    Security needs reduced risk, operations needs continuity, application owners need supported interfaces and IAM teams need lifecycle accountability. A Tech Lead turns these concerns into explicit architecture decisions backed by evidence.

    The question is not who picks the preferred account type. It is whether the organization can deliver a secure target design through a transition that is practical, observable and reversible.

    Conclusion: migrate the access path, not just the account

    Replacing legacy service accounts is an important modernization step, but creating a service principal or managed identity is only one part of the work.

    The target architecture describes where to go. The transition architecture proves whether you can get there safely. Capability, permissions, monitoring, recovery and retirement must all be evidenced before the migration can be considered complete.

    Sources and further reading

    Technical product capabilities are based on public Microsoft documentation. The transition gates are my own proposed architecture framework.

    1. Microsoft Entra: workload identities
    2. Microsoft Entra: authorizing applications and workloads
    3. Microsoft Graph: app-only access
    4. Microsoft Entra: workload identity federation
    5. Exchange Online PowerShell: app-only authentication
    6. Exchange Online: RBAC for Applications
    7. Microsoft Entra: service principal sign-in logs
    8. Microsoft Entra: governing service accounts

    Questions answered

    Answering the core questions

    How does a service account differ from a workload identity?

    A traditional service account is often a user account employed by software. A workload identity represents an application or service as its own actor. In Microsoft Entra, service principals and managed identities are examples; supported authentication and authorization vary by workload.

    Is a managed identity always better than a service principal?

    A managed identity is a type of service principal whose credentials are managed by Microsoft. It is attractive when the runtime and target resource support it, but it is not available in every scenario.

    When can a legacy service account be disabled?

    Only after dependencies are identified, required capabilities and permissions are tested in the real runtime, monitoring works, continuity is assured and a formal retirement decision has been made.

    Microsoft 365 Control Model

    The Control Model connects leadership, identity, devices, data, collaboration, platform operations and adoption & AI.

    Read the Microsoft 365 Control Model