How to Configure a Proxy for Your Azure DevOps Build Agent

All of a sudden, our build agent could no longer communicate with Azure. A failed network change forced us to set a proxy server manually. While most browsers use the system proxy, the build agent did not.

For the build agent you need to create a .proxy file with the proxy URL in the root directory of your agent. Let us look how you can do that.

  1. Locate the root directory of your build agent (this is the folder that contains the run.exe and the _work folder).
  2. Open a Command Prompt at this location.
  3. Type this command, but replace PROXYIP & PORT with your values:
  4. Check that your .proxy file is created at the right place:
    .proxy must be in same folder as _work and run.exe
  5. Optional: If your proxy needs authentication, you must set these environment variables:
  6. Restart the service for your build agent.

Your build agent should now connect to Azure and work as expected.

When you know that you need a proxy at the time of the installation, you can configure the proxy settings right when you call config.cmd:

2 thoughts on “How to Configure a Proxy for Your Azure DevOps Build Agent”

  1. So, “.proxy” should contains only one row with proxy address?
    If the username/password contains a special chars like “%” should be converted to “%25”?

    Reply
    • Hi ALexander,
      As far as I know there should only be one line in the .proxy file. I would try the passwort first without the escape sequence for special chars, but I have no experience with proxies that require authentication.

      Regards,
      Johnny

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.