PUBLIC BETA OFFER

Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026

AZ-401: Azure Pipelines Workload Identity and Service Connections

Create a scoped Azure Pipelines federated service connection and verify identity claims, individual pipeline permission, token exchange, Azure access and owned restoration.

Guide

Content version 1.0

AZ-401: Azure Pipelines Workload Identity and Service Connections

AZ-401: Azure Pipelines Workload Identity and Service Connections

For Azure DevOps Services, use an Azure Resource Manager (ARM) service connection with workload identity federation (WIF), choose a supported identity/setup route, scope the Azure permissions and authorize the intended pipeline individually. Then verify the connection's actual issuer and subject, successful token exchange, and the permitted resource operation as separate observations. A secretless connection establishes neither a resource role nor permission for every pipeline to use it.

The worked procedure uses the documented automatic app-registration route in an authorized Azure public-cloud nonproduction scope. It requires the route's actual prerequisites and an existing compatible pipeline task. The alternative existing managed-identity route is a deliberate identity choice, not an assumption that an agent's identity supplies federation automatically. No connection, credential, pipeline or Azure resource was changed for this explanation.

Separate identity, connection use and resource authorization

Start with Project Repository and Team Access Boundaries to establish the actual Azure DevOps actors and effective access. Keep the following decisions separate when recording the connection design:

Decision Evidence to obtain
Who can create or manage this connection? Actual project/connection authority and the responsible owner
Which Azure identity will the connection represent? Correct tenant, application/service principal or selected managed identity
Which workload assertion is trusted? The exact issuer and subject associated with this connection's federation
Which pipeline can use the connection? An explicit individual pipeline authorization
What can the Azure identity do? Actual role and resource scope, including relevant inherited access
What else can stop deployment? Agent access and resource-owner approvals/checks, evaluated separately

Azure role-based access control (RBAC) and pipeline authorization answer different questions. An authorized pipeline may still receive an Azure access denial. An Azure identity with a resource role does not thereby authorize an arbitrary pipeline to obtain its connection.

The service-connection name used in task properties is also distinct from the Azure subscription name. Preserve both in the input record so an operator can tell which connection a task actually selected.

Select an applicable identity route

The service-connection guide documents automatic app registration with federation and a route for an existing user-assigned managed identity. Choose according to the actual identity lifecycle, ownership and setup authority.

A system-assigned managed identity follows its Azure resource's lifecycle. A user-assigned identity has an independent lifecycle and can be shared by multiple resources. Those properties do not grant downstream access or make every identity compatible with every service-connection method. Do not substitute a generic managed-identity token recipe for the documented connection setup.

For the automatic route below, the guide requires Azure subscription Owner authority, a supported environment and compatible tasks. Azure Stack and Azure US Government are excluded from this particular automatic method. Marketplace extension tasks must support federation. These setup restrictions are separate from the legacy-issuer retirement scope.

If those conditions are not met, stop this route. Use an applicable documented existing-identity route through its owners instead of acquiring broad permissions or inventing manual portal or command-line steps. The guide's separate service-principal key/certificate form is not a federation recipe merely because it uses the same identity category.

Prepare one scoped connection exercise

Use a private, owner-approved nonproduction exercise context. Record actual values for:

  • The Azure DevOps organization/project, intended new connection name and connection owner.
  • The existing test pipeline, its owner and its compatible Azure task.
  • The Azure cloud, tenant, subscription and approved resource group.
  • The intended identity/setup route and who can inspect its resulting federation.
  • The harmless resource operation to be permitted, its precise target and the resource owner's approved role/scope.
  • A separate owner-approved negative case where that identity should lack the required resource permission.
  • Existing pipeline permissions, relevant Azure grants and any resource-owner checks that must remain unchanged.
  • The owned artifacts and permissions that will be removed or retained after the exercise.

Use an existing task and operation whose inputs and results are understood. This procedure does not invent a task name, a universal connection-input field or an Azure command. Select the documented connection input for that actual task and use the exact recorded service-connection name.

Choose an operation that exposes no secret and creates no production change. The negative case must also be harmless. Do not test denial by attempting a destructive operation against somebody else's resource.

Create the automatic federated service connection

After confirming all prerequisites:

  1. Open the project's Project settings, then Service connections.
  2. Choose New service connection, Azure Resource Manager, then Next.
  3. Select App registration (automatic) with Workload identity federation.
  4. Choose Subscription scope and the approved subscription/resource group.
  5. Enter the intended service-connection name.
  6. Leave Grant access permission to all pipelines unselected.
  7. Save, then authorize only the recorded pipeline through the individual connection-permission control.

Reopen the saved connection and compare its actual identity and Azure scope with the exercise record. Preserve the real save/validation result. A displayed success is setup evidence; it is not the pipeline's observed token exchange or a completed resource-access test.

Have the identity and resource owners inspect what was actually created or assigned. Confirm the intended principal and its effective Azure role/scope. If the result exceeds the approved authorization, stop before running the pipeline and have the owner reconcile it through the established role-management process. Do not infer a particular role grant from the use of federation or from a scope selector alone.

For an approved existing user-assigned identity instead, the guide's route selects Managed identity, its containing subscription/resource group and identity, followed by the Azure access scope and connection details. That route requires the identity to exist already. Keep its existing consumers and grants in view; a shared identity is not disposable exercise material.

Verify the exact trust values

Use the actual identity/federation information produced by the applicable setup, inspected through the authorized owners. Record the connection's exact issuer and subject alongside the corresponding trust configuration. An issuer identifies the issuing authority; the subject identifies the asserted workload that the credential trusts. Both values must match the applicable configuration, including its actual segments and spelling.

Do not manufacture a full issuer from a generic base address or rebuild a subject from a project or connection display name. A copied legacy pattern is not proof of the current connection's values. If the actual values cannot be inspected or their correspondence cannot be established, stop before claiming trust verification.

This check needs the real connection-specific strings, not abbreviated labels in an evidence record. Keep that record in the authorized environment. It is unnecessary and unsafe to print a raw token to make the comparison visible; use approved configuration and sanitized diagnostic evidence.

The service-connection guide states that applicable new connections use the Microsoft Entra issuer. The legacy Azure DevOps issuer retires on July 1, 2027 for the documented Azure public-cloud connections using single-tenant applications or managed identities. Multitenant applications and non-public clouds are excluded. Do not apply that date universally or confuse it with the automatic method's environment restrictions.

For an existing connection, inspect its actual configuration and the applicable update/conversion guidance. Do not edit an issuer label in isolation or assume that an unchanged historical example completes a migration. Recheck the actual trust and access after an authorized change.

Run the pipeline and distinguish each boundary

Bind the existing compatible task to the exact connection. Preserve the pipeline revision, connection selection, intended resource and operation. Run only the authorized harmless test and retain the actual task's authentication and access evidence.

Separate these observations:

  1. Pipeline authorization: The specific pipeline is permitted to use this connection.
  2. Federation and exchange: The task obtains and exchanges the applicable workload assertion for the intended Azure identity.
  3. Resource authorization: The resulting identity can perform the selected operation at the intended resource.
  4. Workload result: Any later deployment or application behavior has its own validation.

Use the actual supported task diagnostics. If the task's evidence does not distinguish exchange from resource access, have its owner obtain an approved sanitized diagnostic or record the layer as unproven. A service-connection save result cannot fill that gap.

The following is a proposed acceptance matrix, not executed output:

Case Observation required
Recorded authorized pipeline, correct trust and permitted resource operation Actual connection use, successful authentication/exchange evidence and the expected resource result
An owned test pipeline not authorized for this connection Connection use is refused; no Azure resource success is claimed
Authorized pipeline with the approved resource-denial case Authentication is distinguished from the actual Azure authorization rejection
Missing or mismatched trust evidence Stop at the unresolved authentication layer; do not broaden the trust merely to obtain a token
Required resource-owner approval/check is unsatisfied The relevant stage remains gated independently of successful connection setup

Perform the unauthorized-pipeline case only on a separately owned test definition. Do not remove a shared pipeline's permission to manufacture a failure. For the resource-denial case, use the prearranged target or operation and establish that the actual principal lacks its required grant.

Retain the decisive error category and the configuration that produced it. A network failure is not an Azure role denial. A task that never ran is not a failed token exchange. An administrator's separate success is not evidence that the pipeline used the intended identity.

Keep checks and execution privileges independent

Resource owners configure approvals and checks outside the pipeline definition. A pipeline author's condition does not substitute for those controls on consumed resources. Federation also supplies no agent-pool access or approval authority. Do not remove a check simply because the connection authenticated successfully.

Review the trust boundary of the existing task and its inputs before granting connection use. As an engineering precaution, keep raw tokens out of logs and prevent untrusted changes from controlling privileged execution. Do not rely on automatic redaction to make a deliberately exposed credential safe.

If a task or extension cannot use federation, return that compatibility issue to its owner. Do not silently add a stored secret as a workaround while describing the result as the same secretless setup.

Diagnose without widening access

Preserve the current connection and pipeline evidence before changing settings. Work through the failed boundary:

  • If connection use is rejected, inspect the actual pipeline grant and selected connection.
  • If authentication fails, compare the exact issuer/subject and intended identity with the applicable federation configuration.
  • If authentication succeeds but Azure denies the operation, inspect that principal's effective role and the exact resource scope.
  • If resource access succeeds but deployment is blocked, inspect the independent resource-owner checks and task/workload evidence.

Repair the identified layer through its owner. Granting every pipeline access or broad Azure administration can conceal the original cause while creating another problem. Retest the same bounded case and preserve the actual before/after observations rather than replacing an error with an unexplained green result.

Restore only owned test changes

Compare the final state with the recorded starting state. Remove only temporary test-pipeline authorization, test-definition changes and Azure permission edges deliberately introduced for this exercise. Have each owner verify the intended retained or restored access.

Account for the newly created connection, application identity and federation artifacts separately. Before removal, inspect whether any other consumer now depends on them. Use the established supported management process; do not assume that removing one artifact proves that every other grant or credential disappeared.

For an existing user-assigned identity, preserve unrelated consumers, role assignments and federation. Never delete the shared identity or an Azure resource as casual connection cleanup. Verify that an owned test path loses the intended access after its temporary authorization is removed, while legitimate consumers still work.

The handoff should explain which pipeline can use which identity, the exact trust values checked, the Azure operation permitted and denied, and the restored end state. Workload authentication, resource authorization and deployment approval remain separate evidence even when no connection secret is stored.

Authoritative Sources

0 views