Hello SR,
Solution / Workarounds:
1. Configure Proxy for the Self-Hosted Agent
You can configure proxy settings for the Azure DevOps agent either during setup or by defining environment variables.
Option A – During Agent Setup: When configuring the agent using config.cmd or config.sh, specify proxy parameters:
./config.cmd --proxyurl http://proxyserver:port --proxyusername "user" --proxypassword "password"
This securely stores proxy credentials in the agent configuration.
Option B – Using Environment Variables:
You can configure the proxy settings for the Azure DevOps agent by setting environment variables on the machine where the agent is running. The agent uses these environment variables to connect to the internet.
Here’s how to configure them:
- Set the following environment variables on the agent machine:
- http_proxy=http://your_proxy:port
- https_proxy=http://your_proxy:port
- no_proxy=*.yourcompany.com (optional, if you need to exclude certain domains from the proxy)
On Windows, you can set these environment variables by going to Control Panel > System and Security > System > Advanced system settings > Environment Variables and adding the above variables.
For Linux agents, add the same variables in the shell profile (e.g., .bashrc, .bash_profile, or .profile).
2. Configure npm for Proxy Access
If your pipeline tasks depend on Node.js or npm packages, configure npm as follows:
npm config set proxy http://your_proxy:port
npm config set https-proxy http://your_proxy:port
You can also authenticate npm tasks with DevOps artifacts using the npmAuthenticate@0 task when behind a proxy. With these documentations : 1. Connect to an Azure Artifacts feed - npm 2. npmAuthenticate@0
3. Verify Firewall / Connectivity
If everything is configured properly and you’re still encountering issues, ensure that the network firewall isn't blocking outbound traffic for the self-hosted agent. Sometimes corporate firewalls or network monitoring tools can block connections that are not from a browser.
Documentation:
- Run a self-hosted agent behind a web proxy
- Create and configure a self-hosted integration runtime
- Configure Managed DevOps Networking
- Proxy configuration files (.proxy and .proxybypass)
- Node.js Proxy Configuration
Disclaimer: This document is not maintained by Microsoft. It is being shared solely for your convenience.
I hope the above helps. Let us know if you have any further questions. Thanks!