Skip to main content
This plugin obtains credentials from the environment or Azure Artifacts Credential Provider. It writes an authenticated .npmrc as a BuildKit secret and leaves your source file unchanged. It follows the same model as npmAuthenticate@0 in Azure DevOps.

Usage

Run buildcharts generate before docker buildx bake. Mount the secret when installing packages:
The npm charts already mount this secret for pnpm.

What it does

  • Reads default and scoped Azure Artifacts registries from .npmrc.
  • Uses endpoint credentials from the environment, otherwise an environment token, otherwise the Azure Artifacts Credential Provider.
  • Validates credentials returned by the provider. If rejected, forces one refresh before failing.
  • Writes npm credentials to .buildcharts/secrets/npmrc and adds the generated Bake secret.
  • Preserves existing credentials when no environment credentials replace them.

Environment variables

  • NPM_AUTHENTICATE_WORKING_FILE
  • NPM_AUTHENTICATE_HELPER_VERSION
  • ARTIFACTS_CREDENTIALPROVIDER_EXTERNAL_FEED_ENDPOINTS
  • ARTIFACTS_CREDENTIALPROVIDER_ACCESSTOKEN
  • AZURE_ARTIFACTS_ENV_ACCESS_TOKEN
  • SYSTEM_ACCESSTOKEN
  • VSS_NUGET_ACCESSTOKEN (legacy)
  • VSS_NUGET_EXTERNAL_FEED_ENDPOINTS (legacy)
ARTIFACTS_CREDENTIALPROVIDER_* is the preferred prefix. The older VSS_NUGET_* variables are legacy names kept for compatibility. See the Artifacts Credential Provider environment variables.

Notes

  • The plugin only authenticates Azure DevOps-hosted npm feeds.
  • If no matching npm sources are found, the plugin skips authentication.

Read more

Last modified on November 10, 2026