How to delete a team project from Team Foundation Service (tfs.visualstudio.com)

Buck Hodges

[UPDATE 9/13/13] You can now use the web UI to delete a team project.

[UPDATE 5/14/13] Updated the URLs and version of VS (used to say preview)

The question came up as to how to delete a team project in the Team Foundation Service (TFService).  When I first tried it, it didn’t work.  Then I realized it’s the one case where you have to explicitly specify the collection name.  It’s surprising because in hosted TFS each account has only one collection.  You cannot create multiple collections currently as you can with on-premise TFS (this will change at some point in the future).  Incidentally, you cannot delete a collection right now either.

You must have installed the Visual Studio 2012 RTM or newer build to do this (you can also use the standalone Team Explorer 2012).  Even with the patch to support hosting, the 2010 version of tfsdeleteproject.exe will not work.

If you leave off the collection, here’s the error you will see when I try to delete the team project called Testing.

C:\project>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com Testing
Team Foundation services are not available from server https://buckh-test2.visualstudio.com.
Technical information (for administrator):
  HTTP code 404: Not Found

With DefaultCollection added to your hosting account’s URL, you will get the standard experience with tfsdeleteproject and successfully delete the team project.

C:\project>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com/DefaultCollection Testing

Warning: Deleting a team project is an irrecoverable operation. All version control, work item tracking and Team Foundation build data will be destroyed from the system. The only way to recover this data is by restoring a stored backup of the databases. Are you sure you want to delete the team project and all of its data (Y/N)?y

Deleting from Build …
Done
Deleting from Version Control …
Done
Deleting from Work Item Tracking …
Done
Deleting from TestManagement …
Done
Deleting from LabManagement …
Done
Deleting from ProjectServer …
Done
Warning. Did not find Report Server service.
Warning. Did not find SharePoint site service.
Deleting from Team Foundation Core …
Done

This is the error you will get when using tfsdeleteproject 2010, even with the patch for hosting access.

C:\Program Files\Microsoft Visual Studio 10.0\VC>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com/DefaultCollection Testing2

Warning: Deleting a team project is an irrecoverable operation. All version control, work item tracking and Team Foundation build data will be destroyed from the system. The only way to recover this data is by restoring a stored backup of the databases. Are you sure you want to delete the team project and all of its data (Y/N)?y

TF200040: You cannot delete a team project with your version of Team Explorer. Contact your system administrator to determine how to upgrade your Team Explorer client to the version compatible with Team Foundation Server.

0 comments

Leave a comment

Feedback usabilla icon