Question: In the Azure DevOps portal, I select a pipeline, then the [...] menu, then Delete.

I see a message asking:

> 
> Are you sure? This action cannot be undone. This will permanently
>  delete the pipeline 'vt3e (1)'. Deletion includes all builds and
>  associated artifacts.
> 
> 
> 

I type in the pipeline name and click OK but the pipeline does not delete.

I have waited some hours.

**[Update]**

F12 in Chrome shows an error in the console:

> 
> ms.vss-build-web.common-library.\_\_y\_\_CePsj5f5zdcIK.min.js:18 Error:
>  One or more builds associated with the requested pipeline(s) are
>  retained by a release. The pipeline(s) and builds will not be deleted
> 
> 
> 

**[Update]**

I am trying to follow the answer given by David D, but when I go to delete a release I get a message

> 
> VS402946: 'Release-8' cannot be deleted as it is currently deployed on
>  stage(s) Stage 1.
> 
> 
> 

**[update]**

[The issue is logged at Microsoft](https://developercommunity.visualstudio.com/content/problem/324411/deleting-a-build-pipeline-does-not-work.html)

Answer: 
I get the same error if I try to delete a pipeline:

> 
> One or more builds associated with the requested pipeline(s) are retained by a release. The pipeline(s) and builds will not be deleted.
> 
> 
> 

On the pipelines page go to the **Runs** tab, should see a list of records. If you click on the three dots to the right of the row you should see an option to **View retention leases**. If you **Remove All** you should then be able to remove that row. You will then need to repeat this step for every row in the the runs tab until all runs have been deleted.

Only then will you be able to delete the parent pipeline.
To fix that problem you can:

1. clone failed stage in the current release pipeline configuration
2. delete the original stage and use a clone instead of a deleted stage with a different name.
3. delete the previous failed release (\*it will be possible)
4. after deleting you can rename the copied stage again.
5. enjoy