Search code examples
proxyazure-devopsagent

AzureDevops Agent - Allow Connection to ADO and Local Nuget feed


Currently we have a build agent which goes via our corporate proxy to communicate with ADO and the public Nuget Repositories.

We now have a need to also pull Nuget packages from our local nuget server.

The problem is, we have the proxy set so that the agent can do what it has always done, and have now added our local nuget feed host to the .proxybypass file.

It doesn't appear that this file is being honored, and is attempting to go via the proxy, and so we are getting a 403 forbidden error from our proxy as it is not configured for local traffic.

Has anyone else come across this scenario, or know of a way around this?


Solution

  • AzureDevops Agent - Allow Connection to ADO and Local Nuget feed

    Just you said, it seems nuget not honor the setting in the .proxybypass file.

    To resolve this issue, you can try to add proxy settings into Nuget.Config file on your build agent server, like following:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <config>
            <add key="http_proxy" value="http://proxy_hostname_or_ip:3128" />
            <add key="https_proxy" value="http://proxy_hostname_or_ip:3128" />
        </config>
    
      <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
      </packageSources>
    
    </configuration> 
    

    You can check the Nuget Proxy Settings and this thread for some more details.

    Hope this helps.