Categories
ALM Team Foundation Server VSO

TFS/VSTS agent behind a corporate proxy

Many companies use a http proxy with authentication. Since TFS 2017 the agents are based on .NET Core to be cross-platform. The new agents are unable to obtain the proxy settings from the operating system (Internet Explorer settings).

I’ve found this solution to set a http proxy for the VSTS agents.

  1. Create a file .proxy in the agents root folder and write the proxy in it.

    Example: http://proxy.contoso.org:8080

  2. Username and password can be set with environment variables
    [Environment]::SetEnvironmentVariable("VSTS_HTTP_PROXY_USERNAME", "proxyuser", "User")
    [Environment]::SetEnvironmentVariable("VSTS_HTTP_PROXY_PASSWORD", "proxypassword", "User")

    See also the documentation on GitHub.

Leave a Reply

Your email address will not be published. Required fields are marked *