We've been using TFS since 2010, regularly upgrading it each year. To manage its data size, we implemented Azure DevOps' retention policies and used API call to remove all leases for all builds and set policy to retain artifacts for 60 days (used below link). How to remove runs with Legacy retention Model
After that we observed a reduction in the size of artifacts, we noticed that nothing was deleted from the content table (tbl_content), and the disk space hasn't been freed up.
Below link mentioned using prc_CleanupDeletedFileContent and prc_DeleteUnusedFiles stored procedure. https://jessehouwing.net/tfs-clean-up-your-project-collection/
Does it remove records from tblContent? What steps should I take to reclaim disk space?
The size of
artifactsgenerally contains the size of the following objects:The packages that have been published into Azure Artifacts feeds and are still retained. It also includes the packages that have been deleted into the Recycle Bin but not permanently deleted.
The artifacts published by the Publish build artifacts task in build pipelines.
To reduce the size of
artifacts, you can try the following things:Set the retention policies in Azure Artifacts feeds to delete packages automatically.
Delete some unneeded packages if they are still retained in Azure Artifacts feeds.
Manually permanently deleted packages that have been deleted into the Recycle Bin if you do not need to recover any of them in the future.
Set the retention policies of pipelines to delete builds automatically.
Delete some unneeded builds if they are still retained in the build pipelines. This will also delete the artifacts published by the Publish build artifacts task in those builds.