NuGetAuthenticate configures authentication to package feeds. A successful authentication task does not configure the outbound proxy for dotnet, nuget.exe or MSBuild.

If the credential setup succeeds and the following restore needs an HTTP proxy, supply that process's environment. For example:

- task: NuGetAuthenticate@1

- script: dotnet restore
  env:
    http_proxy: $(proxyUrl)
    no_proxy: packages.corp.example,localhost,127.0.0.1

proxyUrl is an existing pipeline variable containing the intended complete proxy URL. Adjust the bypass list to the actual feed routing policy. For public feeds allowed through a public intermediary, the HTTP proxy list supplies candidates for a no-account proxyUrl; keep private-feed bypasses in place. This fragment assumes the project's package sources are already configured.

On Linux and macOS, the documented environment names are lowercase. A pipeline variable named http_proxy can become uppercase when automatically exported. An explicit env mapping preserves the key needed by the tool.

For a self-hosted agent, another option is configuring these values in the agent process's environment and restarting that agent after changing them. An unrelated terminal's environment does not update an already running service.

NuGet also supports proxy entries in its configuration. Keep those separate from package-source credentials, and check the effective configuration scope when a restore runs under another account.

A restored package can require more than the feed's first URL. If a later package download or authentication host fails, use that actual hostname when evaluating the proxy and bypass policy.

Mikanda mikatakata