How to configure a proxy in a .Net Core Console App -


in previous .net console applications can avoid proxy 407 errors including following in app.config:

<system.net>   <defaultproxy usedefaultcredentials="true"/> </system.net> 

.net core console app not have app.config - how can same?

specifically azure documentdb documentclient.

it looks azure-oriented team didn't implement such feature. here link recent github issue azure ad library, states that

  • currently adal .net doesn’t support webproxy configuration.
  • please configure proxy @ system level. httpclient used adal should able use it.
  • production team has planned add function in future version, don’t have estimation time.

as far 1 can see, there no such feature available in microsoft.azure.documents.client namespace or in microsoft.azure.documents namespace, have resolve on system level. can create github issue or contact team on msdn or email.

as general .net core app, can use httpclienthandler class' defaultproxycredentials property, code this:

var handler = new httpclienthandler { usedefaultcredentials = true }; using (var client = new httpclient(handler)) {     // http call here } 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -