Skip to Content
PrerequisitesSetting up Private Registry

Getting Started with Private Registry

We publish our frontend packages to a custom private registry hosted on Azure DevOps. This guide walks you through how to configure your environment and projects to authenticate and install or publish packages.


1. Generate a Personal Access Token (PAT)

We use Personal Access Tokens  to authenticate with our private Azure registry.

Generate your PAT at: https://dev.azure.com/alzasoft/_usersSettings/tokens 

Required Scopes

  • Installing onlyPackaging: Read
  • Installing + publishingPackaging: Read & Write

Token Expiry PATs expire after a set period. The maximum lifetime is one year — set a reminder to renew before it expires.


2. Project & User Configuration

Project-level .yarnrc.yml

Create or update .yarnrc.yml in your project root:

npmScopes: alza: npmRegistryServer: "https://alzasoft.pkgs.visualstudio.com/Alza.FE/_packaging/AlzaFE/npm/registry/" npmAlwaysAuth: true

User-level .yarnrc.yml

  • Windows: C:/Users/<you>/.yarnrc.yml
  • macOS/Linux: ~/.yarnrc.yml
npmScopes: alza: npmAuthIdent: u:<YOUR_PAT>

The npmAuthIdent value uses HTTP Basic Auth format — u:<YOUR_PAT>. The u: is the username (any value works) and the PAT is the password. You can use any string before the colon.


3. Installing a Package

Once configured, install packages as usual:

bash yarn add @alza/react-ui

4. Publishing a Package

Prerequisites

Your package.json must include a publishConfig pointing to the private registry:

{ "publishConfig": { "registry": "https://alzasoft.pkgs.visualstudio.com/Alza.FE/_packaging/AlzaFE/npm/registry/" } }

Build & Publish

1. Build your package

yarn build

2. Publish

In a Yarn workspaces monorepo, run from the repo root:

yarn workspace <package-name> npm publish

Or from inside the package directory:

yarn npm publish

Ensure your PAT has Packaging: Read & Write permissions before publishing.


Troubleshooting

ErrorCauseFix
401 UnauthorizedInvalid or expired PATRegenerate your PAT and update your config
Package not foundRegistry not configured or wrong scopeVerify @alza scope points to the correct registry
Auth issuesWrong config file location or formatDouble-check both user-level and project-level config paths
Last updated on