title: Configure VSTS build agent to work through a web proxy and connect to Team Services?
body: <p>Current agent version: '2.120.1'
  I googled and follow this link <a href="https://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windows" rel="nofollow noreferrer">https://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windows</a>, created .proxy file, put under agent root directory. Based on below information, I think my condition meet “grant permissions to the user under which the agent runs”, but it doesn’t work, then I add environment variables, still not work.</p>
  <blockquote>
  <p>If your proxy requires authentication, the simplest way to handle it is to grant permissions to the user under which the agent runs. Otherwise, you can provide credentials through environment variables. When you provide credentials through environment variables, the agent keeps the credentials secret by masking them in job and diagnostic logs. To grant credentials through environment variables, set the following variables:</p>
  <p>$env:VSTS_HTTP_PROXY_USERNAME = &quot;proxyuser&quot;
  $env:VSTS_HTTP_PROXY_PASSWORD = &quot;proxypassword&quot;</p>
  </blockquote>
  <p>Another issue is when I add .proxy file to agent root folder, restart the agent machine, it will never online in VSTS, until I remove .proxy file and restart. Don't know why.</p>