Delete and recover packages

Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | Team Foundation Server 2018 | Team Foundation Server 2017

Azure Artifacts safely stores different types of packages in your feed, whether you published them directly or saved them from upstream sources. As older package versions fall out of use, you might want to clean them up either manually or automatically by using retention policies.

In this article, you'll learn how to:

  • Delete packages from feeds.
  • Set up retention policies to automatically delete older packages.
  • Recover recently deleted packages from the Recycle Bin.

Note

To delete/recover packages or set up retention policies, you must be a feed Owner.

Delete packages

  1. Select Artifacts, and then select your feed.

  2. Select the package that you want to delete, and then select Delete latest. Select Delete to confirm.

  1. Select Build and Release, and then select Packages.

  2. Select your feed, and then select the package that you want to delete.

  3. Select Delete latest to delete the latest version of your package.

    Screenshot that shows the button to delete packages from feeds.

In Azure Artifacts, packages are immutable. When you publish a package to your feed, its version number will be reserved permanently. You can't upload a new package with that same version number, even if you delete it from your feed.

Note

Packages sent to the Recycle Bin will be deleted permanently after 30 days. However, these packages still count as part of your storage bill. If you want to delete them sooner, go to the Recycle Bin and delete them manually.

Delete packages automatically with retention policies

The number of versions for each package hosted in your feed can grow quickly. To free up storage space, you can set up retention policies to automatically delete old packages.

If you want to retain a package indefinitely, you can promote it to a view. Packages promoted to a view are exempt from retention policies and won't be deleted.

Note

Package demotion is not supported. If you want this feature to be added to future releases, feel free to use Suggest a feature on our Azure DevOps Developer Community page.

To configure retention policies:

  1. Select Artifacts.

    Screenshot that shows the Artifacts button.

  2. Select the gear icon in your feed, and then select Feed settings.

    Screenshot that shows feed settings.

  3. Select the Feed details tab, and then select the Enable package retention checkbox. Then enter values for:

    • Maximum number of versions per package: How many versions of a package you want to keep.
    • Days to keep recently downloaded packages: Packages will be deleted only if they haven't been downloaded for the number of days set in here.

    Screenshot that shows how to enable retention policies for your feed.

  4. Select Save when you're done.

  1. Select Build and Release.

  2. Select Packages, and then select the gear icon to access your feed's settings.

    Screenshot that shows how access the feed's settings in Team Foundation Server.

  3. From the Retention tab, enter values for:

    • Maximum number of versions per package: How many versions of a package you want to keep.
    • Days to keep recently downloaded packages: Packages will be deleted only if they haven't been downloaded for the number of days set in here.

    Screenshot that shows retention policies in Team Foundation Server.

  4. Select Save when you're done.

Note

When you enable package retention, a version of a package will be deleted when both of the following criteria are met:

  • The number of published versions reaches the Maximum number of versions per package limit.
  • A version of that package has not been downloaded for the period defined in Days to keep recently downloaded packages.

What happens with old or existing packages when we enable retention policies?

Old or existing packages will be soft-deleted and moved to the Recycle Bin. The deletion job runs once a day, but there might be an initial delay after the policy is turned on for the first time because of an influx of packages.

Packages remain in the Recycle Bin for 30 days before they're permanently deleted. To remove the packages from your billable storage, you can choose to delete them manually by using the UI or the REST API before the 30 days are up.

Recover deleted packages

Deleted packages will remain in the Recycle Bin for 30 days. After that, they'll be permanently deleted. You must be a feed Owner to recover deleted packages.

  1. Select Artifacts.

    Screenshot of how to access Azure Artifacts.

  2. Select Recycle Bin.

    Screenshot of the Recycle Bin button.

  3. Select the appropriate package, and then select the package version that you want to delete.

  4. Select Restore to feed.

    Screenshot of how to restore deleted packages.

  1. Select Build and Release, and then select Packages.

  2. Select Recycle Bin.

    Screenshot of how to access the Recycle Bin in Team Foundation Server.

  3. Select the appropriate package, and then select the package version that you want to delete.

    Screenshot that shows the package in the Recycle Bin in Team Foundation Server.

  4. Select Restore to feed.

    Screenshot that shows the button for restoring to feed in Team Foundation Server.