Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

artifacts-credprovider

> 编程语言
Open source

The Azure Artifacts Credential Provider enables dotnet, NuGet.exe, and MSBuild to interactively acquire credentials for Azure Artifacts feeds.

940 stars0 likes1 views
WebsiteGitHub

About

The Azure Artifacts Credential Provider enables dotnet, NuGet.exe, and MSBuild to interactively acquire credentials for Azure Artifacts feeds.

Azure Artifacts Credential Provider

The Azure Artifacts Credential Provider automates the acquisition of credentials for your Azure Artifacts feed. It is most commonly used as a component in package manager tools, such as credential providers for dotnet, npm, Maven, pip, and others. Used directly, it integrates with MSBuild and NuGet(.exe). Windows, Mac, and Linux are all supported.

Any time you want to restore or install packages from an Azure Artifacts feed, the Credential Provider will automatically acquire and securely store a token on behalf of the NuGet client you're using.

  • Prerequisites
  • Setup
  • Use
  • Session Token Cache Locations
  • Environment Variables
  • Release version 1.0.0
  • Upcoming version 2.0.0
  • Help
  • Contribute

Prerequisites

If using one of the credential provider tools for other package management ecosystems (Maven, pip, etc.), follow the guidance for that tool. A separate installation of the Azure Artifacts Credential Provider may not required.

For dotnet

dotnet tool installation requires the .NET SDK version 9.0.200 or later. You can read about dotnet tool in its public documentation. If you use Visual Studio, .NET 9 may already be included. Users of Visual Studio Code may already have it installed via the C# Dev Kit extensions.

If you need to use .NET 8, use the plugin method described for NuGet below.

For MSBuild on Windows

Install Visual Studio version 15.9-preview1 or later to get the required version of MSBuild (15.8.166.59604 or later). Alternatively, you can download MSBuild directly by downloading the Build Tools for Visual Studio. MSBuild is also installed as a part of the .NET Core SDK.

For NuGet

nuget.exe on the command line version 4.8.0.5385 or later is required. The recommended NuGet version is 5.5.x or later as it has some important bug fixes related to cancellations and timeouts.

For Linux self-contained installs

Self-contained .NET applications on Linux may require additional native dependencies such as libicu and libssl. See .NET 8 Linux packages and Self-contained Linux applications for the full list of dependencies.

Setup

dotnet

Use the tool installer included with dotnet to acquire and install the credential provider specific to dotnet, regardless of operating system.

bash
dotnet tool install --global  Microsoft.Artifacts.CredentialProvider.NuGet.Tool

If your project is already configured through a nuget.config to use an Azure Artifacts feed exclusively, you may need to run the command from a folder outside of your project. Alternatively, you can specify nuget.org as the source:

bash
dotnet tool install --global  Microsoft.Artifacts.CredentialProvider.NuGet.Tool --source https://api.nuget.org/v3/index.json

Optionally, use the --version parameter to pin to a major version, especially when installing on containers:

bash
dotnet tool install --global  Microsoft.Artifacts.CredentialProvider.NuGet.Tool --version 2.* --source https://api.nuget.org/v3/index.json

Most users will not require further install steps. Some containers or manual dotnet install scenarios require adding the dotnet tools directory to your PATH (e.g., ENV PATH="$PATH:/root/.dotnet/tools"). See samples/dockerfile.sample for an example.

nuget.exe or MSBuild

If you are using nuget.exe, you can use the Azure Artifacts Credential Provider by adding it to NuGet's plugin search path. This section contains both manual and scripted instructions for doing so. If necessary, the plugin method also works for dotnet.

dotnet needs the netcore version to be installed. NuGet and MSBuild need the netfx version to be installed.

Once the plugin has been added, follow the OS-specific installation instructions below.

Installation on Windows

Automatic PowerShell script

The PowerShell helper scripts require PowerShell 5.1 or later.

PowerShell helper script

  • To install netcore, run installcredprovider.ps1
    • e.g. iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) }"
    • .NET 6 bits can be installed using iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -InstallNet6"
    • .NET 8 bits can be installed using iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -InstallNet8"
  • To install both netfx and netcore, run installcredprovider.ps1 -AddNetfx. The netfx version is needed for nuget.exe.
    • e.g. iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
    • .NET Framework 4.8.1 support is available using the -AddNetFx48 flag

Manual installation on Windows

  1. Download the latest release of Microsoft.Net8.NuGet.CredentialProvider.zip
  2. Unzip the file
  3. Copy the netcore (and netfx for nuget.exe) directory from the extracted archive to $env:UserProfile\.nuget\plugins (%UserProfile%/.nuget/plugins/)

Using the above is recommended, but as per NuGet's plugin discovery rules, alternatively you can install the credential provider to a location you prefer, and then set the environment variable NUGET_PLUGIN_PATHS to the .exe of the credential provider found in plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe. For example, $env:NUGET_PLUGIN_PATHS="my-alternative-location\CredentialProvider.Microsoft.exe". Note that if you are using both nuget.exe and dotnet, this environment variable is not recommended due to this issue: https://github.com/NuGet/Home/issues/8151

Installation on Linux and Mac

Automatic bash script

Linux or Mac helper script

Examples:

  • wget -qO- https://aka.ms/install-artifacts-credprovider.sh | bash
  • sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)"

Note: this script only installs the netcore version of the plugin. If you need to have it working with mono MSBuild, you will need to download the version with both netcore and netfx binaries following the steps in Manual installation on Linux and Mac

Note: The scripts install the latest, self-contained versions by default. For installs on Linux, see prerequisites for Linux self-contained installs for additional dependencies or use the ARTIFACTS_CREDENTIAL_PROVIDER_NON_SC variable to use the non-self-contained version that requires the .NET runtime.

Manual installation on Linux and Mac

  1. Download the latest release of Microsoft.NuGet.CredentialProvider.tar.gz
  2. Untar the file
  3. Copy the netcore (and netfx for msbuild /t:restore) directory from the extracted archive to $HOME/.nuget/plugins

Using the above is recommended, but as per NuGet's plugin discovery rules, alternatively you can install the credential provider to a location you prefer, and then set the environment variable NUGET_PLUGIN_PATHS to the .dll of the credential provider found in plugins\netcore\CredentialProvider.Microsoft\CredentialProvider.Microsoft.dll. For example, $env:NUGET_PLUGIN_PATHS="my-alternative-location\CredentialProvider.Microsoft.dll".

Users requiring .NET 6, such as ARM64 users, can manually download the .NET 6 version Microsoft.Net6.NuGet.CredentialProvider of the 1.0.0 release. Support for .NET 8 was added in release 1.3.0 and can be downloaded with the Microsoft.Net8.NuGet.CredentialProvider archive for runtime-dependent installs, or RID-specific archives (e.g., Microsoft.win-x64.NuGet.CredentialProvider) for self-contained installs (v2.0.0+).

Automatic usage

  • MSBuild in Visual Studio Developer Command Prompt with Visual Studio 15.9+
  • Azure DevOps Pipelines NuGetAuthenticate task
  • Azure DevOps Pipelines NuGet task, NuGetCommandV2 version 2.145.3+ (Azure DevOps Server 2019 Update 1+)

Use

The Azure Artifacts Credential Provider is most commonly used indirectly, either through a credential provider specific to a package management ecosystem or by performing a NuGet operation that requires authentication such as dotnet, nuget.exe, or MSBuild.

dotnet

The first time you perform an operation that requires authentication using dotnet, you should either use the --interactive flag to allow dotnet to prompt you for credentials, or provide them via an environment variable.

If interactive authorization is available, navigate to your project directory and run:

bash
dotnet restore --interactive

Once you've successfully acquired a token, you can run authenticated commands without the --interactive flag for the lifespan of the token, saved in the session token cache location.

nuget.exe

The nuget.exe client will prompt for authentication when you run a restore and it does not find credentials in the session token cache location. By default, it will attempt to open a dialog for authentication and will fall back to console input if that fails.

bash
nuget restore

When using Windows and you are already signed in to Azure DevOps, Windows Integrated Authentication may be used to get automatically authenticated as the signed in user.

MSBuild

The first time you perform an operation that requires authentication using MSBuild, you must use the /p:nugetInteractive=true switch to allow MSBuild to prompt you for credentials. For example, to restore packages, navigate to your project or solution directory and run:

bash
msbuild /t:restore /p:nugetInteractive=true

Once you've successfully acquired a token, you can run authenticated commands without the /p:nugetInteractive=true switch.

Unattended build agents

Azure DevOps Pipelines

Use the NuGetAuthenticate task before running NuGet, dotnet or MSBuild commands that need authentication.

Other automated build scenarios

If you're running the command as part of an automated build on an unattended build agent outside of Azure DevOps Pipelines, you can supply an access token directly using the ARTIFACTS_CREDENTIALPROVIDER_EXTERNAL_FEED_ENDPOINTS environment variable. The use of Personal Access Tokens is recommended f

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言