Mark
Mark

Reputation: 560

How to delete an orphaned Devops Service Connection?

In the Azure Devops GUI inside the project, I see 3 Devops Service connections: SC1 (ARM), SC2 (ARM) and SC3 (Nuget). If I try to delete SC1 (ARM), it immediately takes me back to the Service Connection screen and it is still there.

Another post suggested using the CLI to delete it and setting deep to false: https://learn.microsoft.com/en-us/cli/azure/devops/service-endpoint?view=azure-cli-latest#az-devops-service-endpoint-delete

But, in this instance the CLI doesn't even list SC1 (ARM) - it only shows SC2 (ARM) and SC3 (Nuget) when doing a "list" on it.

Upvotes: 0

Views: 1205

Answers (1)

Mark
Mark

Reputation: 560

I have fixed this as follows:

  1. Click the orphaned Service Connection in the GUI.
  2. Note the URL, it'll have resourceId= followed by a GUID; make a note of this GUID.
  3. Now use that GUID to delete the orphaned service Connection using the CLI:
az devops service-endpoint delete --organization "My-Org" --project "My-Project" --id "GUID"

(substituting the correct values including the GUID from above).

Upvotes: 3

Related Questions