One concept that keeps coming back is the idea of the “monorepo,” or one repository for all the code that goes into all the projects running across an organization. Everyone has access to the same internally developed libraries and all the code. The intent is to organic best practices and reduce duplication, all to avoid common pitfalls and ensure that costs are encouraged. This approach helps manage inner-source projects where teams aim to standardize common libraries and components, developed in-house across teams using open source approaches.
A common repository for your organization
At the heart of Azure Artifacts is the idea of the feed. Feeds are how you organize and store packages and control access. You can mix different package types in a single feed, scoping the feeds to either an entire organization or a specific project. There’s even the option of a public feed, ideal for open source projects so that the wider world has access to your package library. One important caveat: A public Azure Artifacts feed needs to be part of a public Azure DevOps project. Private feeds are automatically created from private projects.
Configuring Azure Artifacts feeds
There are two types of private artifact feeds. You can tell the difference from the URL the service generates for each feed: project feeds include a project name as well as the organization name. If you’re using an organization-level feed, all the feeds are available from the Azure Artifacts drop-down menu. Project feeds can only be found from the Azure DevOps project in question, so users will need to know how to navigate to it. To secure your artifact repositories, either disable public projects or use the feed permission API on programmatically generated feeds.
The default is to allow any Azure DevOps user to create and administer feeds; In practice, you’re more likely to lock creation down to a group of administrators and approved users. It’s an approach that, for example, limits usage to architects as a way of enforcing coding standards. Once you’ve created a feed, you’re automatically an administrator and can control permissions and other feed settings. Users can be assigned appropriate roles, for instance, a reader who can only see and install packages or a contributor who can add their own artifacts to a feed. If you want to support working with upstream packages, these can be managed by users with collaborator permissions and by feed owners and administrators.
At the same time, you can control the views that users have: the default @local view which shows everything or the @prerelease view which includes test versions of packages to allow testers to try out builds before they’re released to the rest of the organization.
If you’re already using NuGet internally, you can use a PowerShell module to migrate your repository to an Azure Artifacts feed. You’ll need your NuGet feed URL and the target Azure Artifacts feed URL, along with any passwords. The process is relatively quick. Once it’s done, you can retarget any .NET package builds to your new feed.
Working with upstream packages
Azure Artifacts can add upstream packages to your feed. This helps ensure that your projects all run on an approved version of a third-party package. You can enable upstream sources in new feeds or add specific public repositories to existing feeds. As you install new packages using tools such as npm or Visual Studio, if you have the correct permissions, they’re automatically added to the current feed. Once a package is saved to a feed, any user can install it. The same process should help manage dependencies and ensure that all necessary packages are in a feed before your team uses them.
Azure Artifacts is part of the Azure DevOps product suite, alongside Azure Pipelines. If you prefer to buy it stand-alone, individuals and teams get the first 2GB of storage free, with additional storage priced at $2 per GB up to 10GB, then $1 per GB up to 100GB, with further reductions for up to 1TB and beyond . You may prefer the free Basic Azure DevOps plan for teams of up to five users. (If you go over that limit, it’s $6 per user per month.) Or it’s part of the fully featured Test plan.
If you hit the initial 2GB limit, you need to add Azure DevOps billing to your account. There’s a warning when you approach the limit; once reached, you won’t be able to upload any more files and may need to delete those that exceed the limit. You can track usage at both an organization and project level. One point to note is that the lowest level of granularity that the service offers is 1GB, so you may not get the detailed tracking you need, especially as it can take as long as 48 hours for file deletion to show up in your usage statistics.
Managing packages and dependencies in a large project can be a big issue, so Azure Artifacts can save time by keeping everyone on the same page. A mix of project and global feeds can ensure that everyone in an organization uses the same packages, a useful option if you’re using inner-source techniques to standardize common controls. With a very low cost of entry, it’s worth setting up a couple of feeds as an experiment before committing to a full Azure DevOps package.
Copyright © 2022 IDG Communications, Inc.