{"id":59818,"date":"2020-09-22T12:32:06","date_gmt":"2020-09-22T20:32:06","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/devops\/?p=59818"},"modified":"2020-10-05T10:15:48","modified_gmt":"2020-10-05T18:15:48","slug":"optimizing-package-storage-and-costs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/optimizing-package-storage-and-costs\/","title":{"rendered":"Optimizing package storage (and costs!)"},"content":{"rendered":"<p>With <a href=\"https:\/\/azure.microsoft.com\/pricing\/details\/devops\/azure-devops-services\/\">tiered-storage<\/a> Artifacts billing, paying attention to your artifacts usage obviously&#8230; pays off <em>(lame joke)<\/em>. Here are some tips and tricks around artifacts storage, to optimize and ultimately reduce your monthly costs.<\/p>\n<p>With the upcoming billing experience <a href=\"https:\/\/devblogs.microsoft.com\/devops\/azure-artifacts-billing-changes-coming-october-2020\/\">changes<\/a>, you will only be charged for packages. Pairing that with our upcoming <a href=\"https:\/\/dev.azure.com\/mseng\/AzureDevOpsRoadmap\/_workitems\/edit\/1566498\" rel=\"noopener noreferrer\" target=\"_blank\">storage breakdown<\/a> feature, this blog post will focus on optimizing and reducing your packages specifically.<\/p>\n<h2>Leveraging automatic retention policies<\/h2>\n<p>We strongly recommend using <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/artifacts\/how-to\/delete-and-recover-packages?view=azure-devops&amp;tabs=maven#automatically-delete-old-package-versions-with-retention-policies\">feed-level retention policies<\/a> to automatically retain and delete packages.<\/p>\n<p>Our retention system will optimize package deletion for the best performance possible. So your feed will continue to operate at full speed, even while processing thousands of delete operations. \u2705 If there&#8217;s one takeaway from this post, it&#8217;s to make sure you&#8217;ve enabled this on all your feeds!<\/p>\n<h2>Sending packages to the bin<\/h2>\n<p>Don&#8217;t need a particular feed anymore? Delete it by going to Feed Settings. Or try taking a look at package stats&#8230; if it&#8217;s not relevant any further, <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/artifacts\/how-to\/delete-and-recover-packages?view=azure-devops&amp;tabs=maven\">delete the package version!<\/a><\/p>\n<h2>Deleting from recycling bin \ud83d\udeae<\/h2>\n<p>When you delete either a feed or a package (with the above instructions), it will be moved into your recycling bin. At that point they&#8217;ll be marked for hard deletion after 30 days. This gives you flexibility in case you realize that certain package versions or feeds have active dependencies and can&#8217;t be deleted! However, these packages remain part of your billable costs. If you don&#8217;t want to wait the full 30 days, you can navigate to the recycling bin, and delete them individually.<\/p>\n<p>We&#8217;re working on additional helpful tutorials on hard deletion of packages, so stay tuned.<\/p>\n<h2>Programatic deletions<\/h2>\n<ul>\n<li>To delete your feeds, you can use our <a href=\"https:\/\/docs.microsoft.com\/rest\/api\/azure\/devops\/artifacts\/feed%20%20management\/delete%20feed?view=azure-devops-rest-6.0\">Feed Management APIs<\/a><\/li>\n<li>To send your packages to the recycling bin (soft delete), you can use our <a href=\"https:\/\/docs.microsoft.com\/rest\/api\/azure\/devops\/artifactspackagetypes\/nuget\/update%20package%20versions?view=azure-devops-rest-6.0\">protocol-specific packages APIs<\/a><\/li>\n<li>Specify &#8216;delete&#8217; as the batchOperationType to delete a batch of packages<\/li>\n<\/ul>\n<h2>Setting cost limits<\/h2>\n<p>There are upcoming changes around the in-product <a href=\"https:\/\/devblogs.microsoft.com\/devops\/azure-artifacts-billing-changes-coming-october-2020\/\">usage limits<\/a> for Artifacts. If you want to stick to the free plan, make sure you&#8217;re set to the &#8220;Up to 2 GiB free&#8221; tier within the Organization Settings ==> Billing page.<\/p>\n<p>Another tip here is to leverage the cost and billing <a href=\"https:\/\/docs.microsoft.com\/azure\/cost-management-billing\/\">management features<\/a> within Azure Portal. We have Azure DevOps documentation on how to pinpoint <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/organizations\/billing\/billing-faq?view=azure-devops#understanding-your-bill\" rel=\"noopener noreferrer\" target=\"_blank\">specific charges<\/a>, so take a peek.<\/p>\n<h2>Start cleaning up your storage \ud83d\udce6<\/h2>\n<p>Hopefully, some of these tips prove helpful in reducing or optimizing your Azure Artifacts storage, starting with packages. Give it a try, and let us know how it goes. Heads up that the deletion for artifacts is processed <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/pipelines\/policies\/retention?view=azure-devops&amp;tabs=yaml#when-are-runs-deleted\">daily<\/a>, so you may see a delay in storage size changes. Please be patient, and do reach out to us if there are any issues!<\/p>\n<p>If you have any suggestions, comments, or run into issues, just post a comment below and we&#8217;ll get back to you ASAP.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With tiered-storage Artifacts billing, paying attention to your artifacts usage obviously&#8230; pays off! Here are some best practices around artifacts storage, to optimize and ultimately reduce your monthly costs. If there&#8217;s one takeaway, it&#8217;s to use feed retention settings! <\/p>\n","protected":false},"author":37262,"featured_media":59770,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[224,1],"tags":[],"class_list":["post-59818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-devops"],"acf":[],"blog_post_summary":"<p>With tiered-storage Artifacts billing, paying attention to your artifacts usage obviously&#8230; pays off! Here are some best practices around artifacts storage, to optimize and ultimately reduce your monthly costs. If there&#8217;s one takeaway, it&#8217;s to use feed retention settings! <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/59818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/37262"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=59818"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/59818\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/59770"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=59818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=59818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=59818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}