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 only —
Packaging: Read- Installing + publishing —
Packaging: 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
Yarn
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: trueUser-level .yarnrc.yml
- Windows:
C:/Users/<you>/.yarnrc.yml - macOS/Linux:
~/.yarnrc.yml
npmScopes:
alza:
npmAuthIdent: u:<YOUR_PAT>The
npmAuthIdentvalue uses HTTP Basic Auth format —u:<YOUR_PAT>. Theu: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:
Yarn
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 build2. Publish
Yarn
In a Yarn workspaces monorepo, run from the repo root:
yarn workspace <package-name> npm publishOr from inside the package directory:
yarn npm publishEnsure your PAT has Packaging: Read & Write permissions before publishing.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid or expired PAT | Regenerate your PAT and update your config |
Package not found | Registry not configured or wrong scope | Verify @alza scope points to the correct registry |
| Auth issues | Wrong config file location or format | Double-check both user-level and project-level config paths |