title: Azure Agent config setup error WinHttp Error: ERROR_WINHTTP_TIMEOUT
body: <p>Getting "WinHttp Error: ERROR_WINHTTP_TIMEOUT" error when config.cmd is run in corporate network over VPN. This worked fine last week, but this week it stopped working.
  Error log is here</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2020-04-22 22:33:37Z ERR  VisualStudioServices] Attempt 4 of GET request to https://dev.azure.com/XYZ/_apis/connectionData?connectOptions=1&amp;lastChangeId=143163415&amp;lastChangeId64=143163415 failed (WinHttp Error: ERROR_WINHTTP_TIMEOUT). The maximum number of attempts has been reached.
  [2020-04-22 22:33:37Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
  [2020-04-22 22:33:37Z INFO LocationServer] Catch exception during connect. 4 attempt left.
  [2020-04-22 22:33:37Z ERR  LocationServer] System.Net.Http.HttpRequestException: An error occurred while sending the request.
   ---&gt; System.Net.Http.WinHttpException (80072EE2, 12002): Error 12002 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'The operation timed out'.
     at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
     at System.Net.Http.WinHttpHandler.StartRequestAsync(WinHttpRequestState state)
     --- End of inner exception stack trace ---
     at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
     at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
     at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
     at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
     at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
     at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.GetConnectionDataAsync(ConnectOptions connectOptions, Int32 lastChangeId, CancellationToken cancellationToken)
     at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
     at Microsoft.VisualStudio.Services.Agent.LocationServer.ConnectAsync(VssConnection jobConnection)
  [20</code></pre>
  </div>
  </div>
  </p>
  
  <p>The GET URL <a href="https://dev.azure.com/XYZ/_apis/connectionData?connectOptions=1&amp;lastChangeId=143163415&amp;lastChangeId64=143163415" rel="nofollow noreferrer">https://dev.azure.com/XYZ/_apis/connectionData?connectOptions=1&amp;lastChangeId=143163415&amp;lastChangeId64=143163415</a> is accessible and when run on powershell window, Response code is 200</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>StatusCode        : 200
  StatusDescription : OK
  Content           : {"authenticatedUser":{"id":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","descriptor":"System:PublicAccess
                      ;aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","providerDisplayName":"Anonymous","customDisplayName":"Anony
                      mo...
  RawContent        : HTTP/1.1 200 OK
                      Pragma: no-cache
                      X-TFS-ProcessId: 2efc9e7a-2854-44d7-ada0-44a58e152504
                      Strict-Transport-Security: max-age=31536000; includeSubDomains
                      ActivityId: 4779c83e-93f6-4107-82fb-ca02c50d4d...
  Forms             : {}
  Headers           : {[Pragma, no-cache], [X-TFS-ProcessId, 2efc9e7a-2854-44d7-ada0-44a58e152504],
                      [Strict-Transport-Security, max-age=31536000; includeSubDomains], [ActivityId,
                      4779c83e-93f6-4107-82fb-ca02c50d4d78]...}
  Images            : {}
  InputFields       : {}
  Links             : {}
  ParsedHtml        : mshtml.HTMLDocumentClass
  RawContentLength  : 368893 </code></pre>
  </div>
  </div>
  </p>
  
  <p>Tried to set the proxy, but the same issue occurring. Any recommendations are welcome</p>