title: Unable to trigger automatic build of source code from external Git in Azure DevOps Using CI pipeline
body: <p>I have the .NET Core Project in the External Git Repository. I have the Azure DevOps Build Pipeline created. The Build is successful and artifacts  gets created when I trigger the Build pipeline manually but failing when its automatic trigger with following error:</p>
  <pre><code>An exception occurred while polling the repository. Error: Microsoft.TeamFoundation.Build2.Server.Extensions.ExternalConnectorException: The underlying connection was closed: An unexpected error occurred on a send. ---&gt; System.Net.Http.HttpRequestException: An error occurred while sending the request. ---&gt; System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---&gt; System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---&gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.&lt;SendAsync&gt;d__17.MoveNext() in D:\v2.0\P1\_work\1\s\Vssf\Client\Common\VssHttpMessageHandler.cs:line 258 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.TeamFoundation.Build2.Server.Extensions.GitConnector.GetBranches(IVssRequestContext requestContext, ExternalConnection connection, Int32 timeoutSeconds, Boolean useAnonymousAccess) in D:\v2.0\P1\_work\1\s\Tfs\Service\Build2\Extensions\SourceProviders\Git\GitConnector.cs:line 0 --- End of inner exception stack trace --- at Microsoft.TeamFoundation.Build2.Server.Extensions.GitConnector.GetBranches(IVssRequestContext requestContext, ExternalConnection connection, Int32 timeoutSeconds, Boolean useAnonymousAccess) in D:\v2.0\P1\_work\1\s\Tfs\Service\Build2\Extensions\SourceProviders\Git\GitConnector.cs:line 145 at Microsoft.TeamFoundation.Build2.Server.Extensions.GitSourceProvider.GetMatchingBranchRefs(IVssRequestContext requestContext, BuildDefinition definition, IList`1 branchFilters) in D:\v2.0\P1\_work\1\s\Tfs\Service\Build2\Extensions\SourceProviders\Git\GitSourceProvider.cs:line 454 at Microsoft.TeamFoundation.Build2.Server.Extensions.GitSourceProvider.GetSourceVersionsToBuild(IVssRequestContext requestContext, BuildDefinition definition, List`1 branchFilters, Boolean batchChanges, String previousVersionEvaluated, Dictionary`2&amp; ciData, String&amp; lastVersionEvaluated) in D:\v2.0\P1\_work\1\s\Tfs\Service\Build2\Extensions\SourceProviders\Git\GitSourceProvider.cs:line 369 at Microsoft.TeamFoundation.Build2.Server.Extensions.BuildPollingJobExtension.Run(IVssRequestContext requestContext, TeamFoundationJobDefinition jobDefinition, DateTime queueTime, String&amp; resultMessage) in D:\v2.0\P1\_work\1\s\Tfs\Service\Build2\Extensions\BuildPollingJobExtension.cs:line 98.
  </code></pre>
  <p>Attached CI Trigger Configuration screenshot</p>
  <p><a href="https://i.stack.imgur.com/K5Mga.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K5Mga.png" alt="enter image description here" /></a></p>