Azure DevOps: Unable to Delete Pipeline Due to Retained Builds — Assistance Needed

Rihan 0 Reputation points
2026-09-28T14:32:32.5033333+00:00

Problem description

I am unable to delete the pipeline 'LDIDashboard-2022' in my Azure DevOps project 'LDIDashboard'. The error indicates that one or more builds from this pipeline are retained by a release, preventing deletion.

Environment

Azure DevOps Services, project: LDIDashboard, pipeline: LDIDashboard-2022, region: not specified in case information.

What I've already tried

I reviewed the guidance on retention policies, checked for retained builds and releases, and attempted to delete the pipeline through the Azure DevOps web UI. No specific build or release details have been identified or modified yet.

Current status

I am seeking assistance to identify the retained builds or releases and to understand how to remove the retention to delete the pipeline successfully.

Azure DevOps

2 answers

Sort by: Most helpful
  1. Likhitha Sulake 105 Reputation points Microsoft External Staff Moderator
    2026-09-29T01:27:48.5+00:00

    Hi @Rihan ,

    Thank you for providing the details.

    Based on the reported error, the deletion of the LDIDashboard-2022 pipeline appears to be blocked because one or more associated pipeline runs/builds are protected by a release retention or retention lease. Azure DevOps will not allow the retained run, or the pipeline associated with it, to be deleted until the applicable retention is removed.

    Please try the following steps:

    Navigate to Pipelines > Releases and identify whether any Classic Release pipeline is consuming artifacts from LDIDashboard-2022.

    Review the associated releases. For releases that are no longer required, disable Retain indefinitely / Keep forever, or delete the release if permitted by your organization's retention requirements.

    Navigate to Pipelines > Pipelines > LDIDashboard-2022 > Runs and check whether any runs have manually applied retention.

    For runs that no longer need to be retained, remove the retention setting from the More actions menu on the run details page.

    Once the applicable release/run retention locks are removed, retry deleting the LDIDashboard-2022 pipeline.

    If the retaining build or release cannot be identified through the Azure DevOps UI, you can use the Azure DevOps Build REST API to identify the retention leases associated with the affected build:

    Get retention leases

    Delete retention leases

    Please delete a retention lease only after confirming that the associated release/build and artifacts are no longer required.

    After completing the above steps, please retry deleting the pipeline and let us know the outcome.

    Was this answer helpful?

    0 comments No comments

  2. Allan Solomon Mejia 10,225 Reputation points
    2026-09-28T15:24:03.6333333+00:00

    Hi @Rihan

    This error means one or more runs from LDIDashboard-2022 are protected by a release-retention lock. Azure DevOps won’t let you delete a retained run or a pipeline protected by its retention lease until you remove the retention.

    Try the following:

    1. Open Pipelines > Releases and identify the classic release pipeline that consumes artifacts from LDIDashboard-2022.
    2. Review its existing releases. For releases that are no longer required, disable Retain indefinitely/Keep forever, or delete the releases if permitted by your organization’s retention requirements. Classic releases automatically retain the pipeline runs they consume.
    3. Open Pipelines > Pipelines > LDIDashboard-2022, review its runs, and remove any manually applied retention from More actions on the run-details page.
    4. After you remove the release and run retention locks, try deleting the pipeline again.

    If the UI doesn’t reveal the retaining item, use the Azure DevOps Build REST API to retrieve the retention leases associated with the affected build. Microsoft also provides an API for deleting specific leases:

    GET

    DELETE

    Only delete a lease after confirming that its associated release and artifacts are no longer required.

    References:

    Azure Pipelines retention policies

    Get retention leases for a build

    Delete retention leases


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.