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.
- Create a file .proxy in the agents root folder and write the proxy in it.
Example: http://proxy.contoso.org:8080
- 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.